PostgreSQL Source Code  git master
pg_dump.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_dump.h
4  * Common header file for the pg_dump utility
5  *
6  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/bin/pg_dump/pg_dump.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 
14 #ifndef PG_DUMP_H
15 #define PG_DUMP_H
16 
17 #include "pg_backup.h"
18 
19 
20 #define oidcmp(x,y) ( ((x) < (y) ? -1 : ((x) > (y)) ? 1 : 0) )
21 
22 /*
23  * The data structures used to store system catalog information. Every
24  * dumpable object is a subclass of DumpableObject.
25  *
26  * NOTE: the structures described here live for the entire pg_dump run;
27  * and in most cases we make a struct for every object we can find in the
28  * catalogs, not only those we are actually going to dump. Hence, it's
29  * best to store a minimal amount of per-object info in these structs,
30  * and retrieve additional per-object info when and if we dump a specific
31  * object. In particular, try to avoid retrieving expensive-to-compute
32  * information until it's known to be needed. We do, however, have to
33  * store enough info to determine whether an object should be dumped and
34  * what order to dump in.
35  */
36 
37 typedef enum
38 {
39  /* When modifying this enum, update priority tables in pg_dump_sort.c! */
61  DO_FK_CONSTRAINT, /* see note for ConstraintInfo */
87 
88 /* component types of an object which can be selected for dumping */
89 typedef uint32 DumpComponents; /* a bitmask of dump object components */
90 #define DUMP_COMPONENT_NONE (0)
91 #define DUMP_COMPONENT_DEFINITION (1 << 0)
92 #define DUMP_COMPONENT_DATA (1 << 1)
93 #define DUMP_COMPONENT_COMMENT (1 << 2)
94 #define DUMP_COMPONENT_SECLABEL (1 << 3)
95 #define DUMP_COMPONENT_ACL (1 << 4)
96 #define DUMP_COMPONENT_POLICY (1 << 5)
97 #define DUMP_COMPONENT_USERMAP (1 << 6)
98 #define DUMP_COMPONENT_ALL (0xFFFF)
99 
100 /*
101  * component types which require us to obtain a lock on the table
102  *
103  * Note that some components only require looking at the information
104  * in the pg_catalog tables and, for those components, we do not need
105  * to lock the table. Be careful here though- some components use
106  * server-side functions which pull the latest information from
107  * SysCache and in those cases we *do* need to lock the table.
108  *
109  * We do not need locks for the COMMENT and SECLABEL components as
110  * those simply query their associated tables without using any
111  * server-side functions. We do not need locks for the ACL component
112  * as we pull that information from pg_class without using any
113  * server-side functions that use SysCache. The USERMAP component
114  * is only relevant for FOREIGN SERVERs and not tables, so no sense
115  * locking a table for that either (that can happen if we are going
116  * to dump "ALL" components for a table).
117  *
118  * We DO need locks for DEFINITION, due to various server-side
119  * functions that are used and POLICY due to pg_get_expr(). We set
120  * this up to grab the lock except in the cases we know to be safe.
121  */
122 #define DUMP_COMPONENTS_REQUIRING_LOCK (\
123  DUMP_COMPONENT_DEFINITION |\
124  DUMP_COMPONENT_DATA |\
125  DUMP_COMPONENT_POLICY)
126 
127 typedef struct _dumpableObject
128 {
130  CatalogId catId; /* zero if not a cataloged object */
131  DumpId dumpId; /* assigned by AssignDumpId() */
132  char *name; /* object name (should never be NULL) */
133  struct _namespaceInfo *namespace; /* containing namespace, or NULL */
134  DumpComponents dump; /* bitmask of components to dump */
135  DumpComponents dump_contains; /* as above, but for contained objects */
136  bool ext_member; /* true if object is member of extension */
137  bool depends_on_ext; /* true if object depends on an extension */
138  DumpId *dependencies; /* dumpIds of objects this one depends on */
139  int nDeps; /* number of valid dependencies */
140  int allocDeps; /* allocated size of dependencies[] */
142 
143 typedef struct _namespaceInfo
144 {
146  bool create; /* CREATE SCHEMA, or just set owner? */
148  char *rolname; /* name of owner, or empty string */
149  char *nspacl;
150  char *rnspacl;
151  char *initnspacl;
152  char *initrnspacl;
154 
155 typedef struct _extensionInfo
156 {
158  char *namespace; /* schema containing extension's objects */
160  char *extversion;
161  char *extconfig; /* info about configuration tables */
164 
165 typedef struct _typeInfo
166 {
168 
169  /*
170  * Note: dobj.name is the raw pg_type.typname entry. ftypname is the
171  * result of format_type(), which will be quoted if needed, and might be
172  * schema-qualified too.
173  */
174  char *ftypname;
175  char *rolname; /* name of owner, or empty string */
176  char *typacl;
177  char *rtypacl;
178  char *inittypacl;
179  char *initrtypacl;
182  char typrelkind; /* 'r', 'v', 'c', etc */
183  char typtype; /* 'b', 'c', etc */
184  bool isArray; /* true if auto-generated array type */
185  bool isMultirange; /* true if auto-generated multirange type */
186  bool isDefined; /* true if typisdefined */
187  /* If needed, we'll create a "shell type" entry for it; link that here: */
188  struct _shellTypeInfo *shellType; /* shell-type entry, or NULL */
189  /* If it's a domain, we store links to its constraints here: */
193 
194 typedef struct _shellTypeInfo
195 {
197 
198  TypeInfo *baseType; /* back link to associated base type */
200 
201 typedef struct _funcInfo
202 {
204  char *rolname; /* name of owner, or empty string */
206  int nargs;
209  char *proacl;
210  char *rproacl;
211  char *initproacl;
212  char *initrproacl;
214 
215 /* AggInfo is a superset of FuncInfo */
216 typedef struct _aggInfo
217 {
219  /* we don't require any other fields at the moment */
221 
222 typedef struct _oprInfo
223 {
225  char *rolname;
226  char oprkind;
229 
230 typedef struct _accessMethodInfo
231 {
233  char amtype;
234  char *amhandler;
236 
237 typedef struct _opclassInfo
238 {
240  char *rolname;
242 
243 typedef struct _opfamilyInfo
244 {
246  char *rolname;
248 
249 typedef struct _collInfo
250 {
252  char *rolname;
254 
255 typedef struct _convInfo
256 {
258  char *rolname;
260 
261 typedef struct _tableInfo
262 {
263  /*
264  * These fields are collected for every table in the database.
265  */
267  char *rolname; /* name of owner, or empty string */
268  char *relacl;
269  char *rrelacl;
270  char *initrelacl;
271  char *initrrelacl;
272  char relkind;
273  char relpersistence; /* relation persistence */
274  bool relispopulated; /* relation is populated */
275  char relreplident; /* replica identifier */
276  char *reltablespace; /* relation tablespace */
277  char *reloptions; /* options specified by WITH (...) */
278  char *checkoption; /* WITH CHECK OPTION, if any */
279  char *toast_reloptions; /* WITH options for the TOAST table */
280  bool hasindex; /* does it have any indexes? */
281  bool hasrules; /* does it have any rules? */
282  bool hastriggers; /* does it have any triggers? */
283  bool rowsec; /* is row security enabled? */
284  bool forcerowsec; /* is row security forced? */
285  bool hasoids; /* does it have OIDs? */
286  uint32 frozenxid; /* table's relfrozenxid */
287  uint32 minmxid; /* table's relminmxid */
288  Oid toast_oid; /* toast table's OID, or 0 if none */
289  uint32 toast_frozenxid; /* toast table's relfrozenxid, if any */
290  uint32 toast_minmxid; /* toast table's relminmxid */
291  int ncheck; /* # of CHECK expressions */
292  char *reloftype; /* underlying type for typed table */
293  Oid foreign_server; /* foreign server oid, if applicable */
294  /* these two are set only if table is a sequence owned by a column: */
295  Oid owning_tab; /* OID of table owning sequence */
296  int owning_col; /* attr # of column owning sequence */
298  int relpages; /* table's size in pages (from pg_class) */
299 
300  bool interesting; /* true if need to collect more data */
301  bool dummy_view; /* view's real definition must be postponed */
302  bool postponed_def; /* matview must be postponed into post-data */
303  bool ispartition; /* is table a partition? */
304 
305  /*
306  * These fields are computed only if we decide the table is interesting
307  * (it's either a table to dump, or a direct parent of a dumpable table).
308  */
309  int numatts; /* number of attributes */
310  char **attnames; /* the attribute names */
311  char **atttypnames; /* attribute type names */
312  int *atttypmod; /* type-specific type modifiers */
313  int *attstattarget; /* attribute statistics targets */
314  char *attstorage; /* attribute storage scheme */
315  char *typstorage; /* type storage scheme */
316  bool *attisdropped; /* true if attr is dropped; don't dump it */
317  char *attidentity;
319  int *attlen; /* attribute length, used by binary_upgrade */
320  char *attalign; /* attribute align, used by binary_upgrade */
321  bool *attislocal; /* true if attr has local definition */
322  char **attoptions; /* per-attribute options */
323  Oid *attcollation; /* per-attribute collation selection */
324  char *attcompression; /* per-attribute compression method */
325  char **attfdwoptions; /* per-attribute fdw options */
326  char **attmissingval; /* per attribute missing value */
327  bool *notnull; /* NOT NULL constraints on attributes */
328  bool *inhNotNull; /* true if NOT NULL is inherited */
329  struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
330  struct _constraintInfo *checkexprs; /* CHECK constraints */
331  char *partkeydef; /* partition key definition */
332  char *partbound; /* partition bound definition */
333  bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
334  char *amname; /* relation access method */
335 
336  /*
337  * Stuff computed only for dumpable tables.
338  */
339  int numParents; /* number of (immediate) parent tables */
340  struct _tableInfo **parents; /* TableInfos of immediate parents */
341  int numIndexes; /* number of indexes */
342  struct _indxInfo *indexes; /* indexes */
343  struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
344  int numTriggers; /* number of triggers for table */
345  struct _triggerInfo *triggers; /* array of TriggerInfo structs */
347 
348 typedef struct _tableAttachInfo
349 {
351  TableInfo *parentTbl; /* link to partitioned table */
352  TableInfo *partitionTbl; /* link to partition */
354 
355 typedef struct _attrDefInfo
356 {
357  DumpableObject dobj; /* note: dobj.name is name of table */
358  TableInfo *adtable; /* link to table of attribute */
359  int adnum;
360  char *adef_expr; /* decompiled DEFAULT expression */
361  bool separate; /* true if must dump as separate item */
363 
364 typedef struct _tableDataInfo
365 {
367  TableInfo *tdtable; /* link to table to dump */
368  char *filtercond; /* WHERE condition to limit rows dumped */
370 
371 typedef struct _indxInfo
372 {
374  TableInfo *indextable; /* link to table the index is for */
375  char *indexdef;
376  char *tablespace; /* tablespace in which index is stored */
377  char *indreloptions; /* options specified by WITH (...) */
378  char *indstatcols; /* column numbers with statistics */
379  char *indstatvals; /* statistic values for columns */
380  int indnkeyattrs; /* number of index key attributes */
381  int indnattrs; /* total number of index attributes */
382  Oid *indkeys; /* In spite of the name 'indkeys' this field
383  * contains both key and nonkey attributes */
386  Oid parentidx; /* if a partition, parent index OID */
387  SimplePtrList partattaches; /* if partitioned, partition attach objects */
388 
389  /* if there is an associated constraint object, its dumpId: */
392 
393 typedef struct _indexAttachInfo
394 {
396  IndxInfo *parentIdx; /* link to index on partitioned table */
397  IndxInfo *partitionIdx; /* link to index on partition */
399 
400 typedef struct _statsExtInfo
401 {
403  char *rolname; /* name of owner, or empty string */
404  int stattarget; /* statistics target */
406 
407 typedef struct _ruleInfo
408 {
410  TableInfo *ruletable; /* link to table the rule is for */
411  char ev_type;
414  bool separate; /* true if must dump as separate item */
415  /* separate is always true for non-ON SELECT rules */
417 
418 typedef struct _triggerInfo
419 {
421  TableInfo *tgtable; /* link to table the trigger is for */
422  char *tgfname;
423  int tgtype;
424  int tgnargs;
425  char *tgargs;
430  char tgenabled;
434  char *tgdef;
436 
437 typedef struct _evttriggerInfo
438 {
440  char *evtname;
441  char *evtevent;
442  char *evtowner;
443  char *evttags;
444  char *evtfname;
447 
448 /*
449  * struct ConstraintInfo is used for all constraint types. However we
450  * use a different objType for foreign key constraints, to make it easier
451  * to sort them the way we want.
452  *
453  * Note: condeferrable and condeferred are currently only valid for
454  * unique/primary-key constraints. Otherwise that info is in condef.
455  */
456 typedef struct _constraintInfo
457 {
459  TableInfo *contable; /* NULL if domain constraint */
460  TypeInfo *condomain; /* NULL if table constraint */
461  char contype;
462  char *condef; /* definition, if CHECK or FOREIGN KEY */
463  Oid confrelid; /* referenced table, if FOREIGN KEY */
464  DumpId conindex; /* identifies associated index if any */
465  bool condeferrable; /* true if constraint is DEFERRABLE */
466  bool condeferred; /* true if constraint is INITIALLY DEFERRED */
467  bool conislocal; /* true if constraint has local definition */
468  bool separate; /* true if must dump as separate item */
470 
471 typedef struct _procLangInfo
472 {
478  char *lanacl;
479  char *rlanacl;
480  char *initlanacl;
481  char *initrlanacl;
482  char *lanowner; /* name of owner, or empty string */
484 
485 typedef struct _castInfo
486 {
494 
495 typedef struct _transformInfo
496 {
503 
504 /* InhInfo isn't a DumpableObject, just temporary state */
505 typedef struct _inhInfo
506 {
507  Oid inhrelid; /* OID of a child table */
508  Oid inhparent; /* OID of its parent */
510 
511 typedef struct _prsInfo
512 {
520 
521 typedef struct _dictInfo
522 {
524  char *rolname;
528 
529 typedef struct _tmplInfo
530 {
535 
536 typedef struct _cfgInfo
537 {
539  char *rolname;
542 
543 typedef struct _fdwInfo
544 {
546  char *rolname;
547  char *fdwhandler;
549  char *fdwoptions;
550  char *fdwacl;
551  char *rfdwacl;
552  char *initfdwacl;
553  char *initrfdwacl;
555 
556 typedef struct _foreignServerInfo
557 {
559  char *rolname;
561  char *srvtype;
562  char *srvversion;
563  char *srvacl;
564  char *rsrvacl;
565  char *initsrvacl;
566  char *initrsrvacl;
567  char *srvoptions;
569 
570 typedef struct _defaultACLInfo
571 {
573  char *defaclrole;
575  char *defaclacl;
576  char *rdefaclacl;
580 
581 typedef struct _blobInfo
582 {
584  char *rolname;
585  char *blobacl;
586  char *rblobacl;
587  char *initblobacl;
590 
591 /*
592  * The PolicyInfo struct is used to represent policies on a table and
593  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
594  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
595  * it's non-NULL then this is a regular policy definition.
596  */
597 typedef struct _policyInfo
598 {
601  char *polname; /* null indicates RLS is enabled on rel */
602  char polcmd;
604  char *polroles;
605  char *polqual;
608 
609 /*
610  * The PublicationInfo struct is used to represent publications.
611  */
612 typedef struct _PublicationInfo
613 {
615  char *rolname;
617  bool pubinsert;
618  bool pubupdate;
619  bool pubdelete;
623 
624 /*
625  * The PublicationRelInfo struct is used to represent publication table
626  * mapping.
627  */
628 typedef struct _PublicationRelInfo
629 {
634 
635 /*
636  * The PublicationSchemaInfo struct is used to represent publication schema
637  * mapping.
638  */
640 {
645 
646 /*
647  * The SubscriptionInfo struct is used to represent subscription.
648  */
649 typedef struct _SubscriptionInfo
650 {
652  char *rolname;
653  char *subconninfo;
654  char *subslotname;
655  char *subbinary;
656  char *substream;
661 
662 /*
663  * common utility functions
664  */
665 
666 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
667 
668 extern void AssignDumpId(DumpableObject *dobj);
669 extern DumpId createDumpId(void);
670 extern DumpId getMaxDumpId(void);
673 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
674 
675 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
676 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
677 
678 extern TableInfo *findTableByOid(Oid oid);
679 extern TypeInfo *findTypeByOid(Oid oid);
680 extern FuncInfo *findFuncByOid(Oid oid);
681 extern OprInfo *findOprByOid(Oid oid);
682 extern CollInfo *findCollationByOid(Oid oid);
686 
687 extern void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext);
688 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
689 
690 extern void parseOidArray(const char *str, Oid *array, int arraysize);
691 
692 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
693  DumpId preBoundaryId, DumpId postBoundaryId);
694 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
695 
696 /*
697  * version specific routines
698  */
699 extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
700 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
701 extern TypeInfo *getTypes(Archive *fout, int *numTypes);
702 extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
703 extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
704 extern OprInfo *getOperators(Archive *fout, int *numOperators);
705 extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
706 extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
707 extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
708 extern CollInfo *getCollations(Archive *fout, int *numCollations);
709 extern ConvInfo *getConversions(Archive *fout, int *numConversions);
710 extern TableInfo *getTables(Archive *fout, int *numTables);
711 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
712 extern InhInfo *getInherits(Archive *fout, int *numInherits);
713 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
714 extern void getExtendedStatistics(Archive *fout);
715 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
716 extern RuleInfo *getRules(Archive *fout, int *numRules);
717 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
718 extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
719 extern CastInfo *getCasts(Archive *fout, int *numCasts);
720 extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
721 extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
722 extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
723 extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
724 extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
725 extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
726 extern TSConfigInfo *getTSConfigurations(Archive *fout, int *numTSConfigs);
728  int *numForeignDataWrappers);
730  int *numForeignServers);
731 extern DefaultACLInfo *getDefaultACLs(Archive *fout, int *numDefaultACLs);
732 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
733  int numExtensions);
734 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
735  int numExtensions);
736 extern EventTriggerInfo *getEventTriggers(Archive *fout, int *numEventTriggers);
737 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
739  int *numPublications);
740 extern void getPublicationNamespaces(Archive *fout);
741 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
742  int numTables);
743 extern void getSubscriptions(Archive *fout);
744 
745 #endif /* PG_DUMP_H */
unsigned int uint32
Definition: c.h:441
int DumpId
Definition: pg_backup.h:244
NamespaceInfo * getNamespaces(Archive *fout, int *numNamespaces)
Definition: pg_dump.c:4983
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7459
struct _collInfo CollInfo
struct _transformInfo TransformInfo
void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext)
Definition: common.c:929
void getPublicationNamespaces(Archive *fout)
Definition: pg_dump.c:4170
struct _opfamilyInfo OpfamilyInfo
struct _indxInfo IndxInfo
DefaultACLInfo * getDefaultACLs(Archive *fout, int *numDefaultACLs)
Definition: pg_dump.c:9694
struct _fdwInfo FdwInfo
struct _triggerInfo TriggerInfo
struct _tmplInfo TSTemplateInfo
struct _tableInfo TableInfo
FuncInfo * findFuncByOid(Oid oid)
Definition: common.c:820
struct _aggInfo AggInfo
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3699
struct _castInfo CastInfo
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:18085
struct _tableDataInfo TableDataInfo
ForeignServerInfo * getForeignServers(Archive *fout, int *numForeignServers)
Definition: pg_dump.c:9544
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:874
struct _cfgInfo TSConfigInfo
AccessMethodInfo * getAccessMethods(Archive *fout, int *numAccessMethods)
Definition: pg_dump.c:5725
FdwInfo * getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
Definition: pg_dump.c:9378
FuncInfo * getFuncs(Archive *fout, int *numFuncs)
Definition: pg_dump.c:6149
TSConfigInfo * getTSConfigurations(Archive *fout, int *numTSConfigs)
Definition: pg_dump.c:9302
struct _dumpableObject DumpableObject
struct _accessMethodInfo AccessMethodInfo
struct _attrDefInfo AttrDefInfo
ConvInfo * getConversions(Archive *fout, int *numConversions)
Definition: pg_dump.c:5653
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6917
ExtensionInfo * findOwningExtension(CatalogId catalogId)
Definition: common.c:953
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition: common.c:97
struct _ruleInfo RuleInfo
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:4257
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition: common.c:677
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7026
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:718
struct _foreignServerInfo ForeignServerInfo
DumpableObject * findObjectByDumpId(DumpId dumpId)
Definition: common.c:664
void parseOidArray(const char *str, Oid *array, int arraysize)
Definition: common.c:1027
struct _inhInfo InhInfo
struct _indexAttachInfo IndexAttachInfo
struct _procLangInfo ProcLangInfo
TSDictInfo * getTSDictionaries(Archive *fout, int *numTSDicts)
Definition: pg_dump.c:9144
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:6980
OpfamilyInfo * getOpfamilies(Archive *fout, int *numOpfamilies)
Definition: pg_dump.c:5873
struct _prsInfo TSParserInfo
struct _policyInfo PolicyInfo
TableInfo * findTableByOid(Oid oid)
Definition: common.c:765
struct _PublicationInfo PublicationInfo
struct _namespaceInfo NamespaceInfo
struct _shellTypeInfo ShellTypeInfo
struct _defaultACLInfo DefaultACLInfo
PublicationInfo * getPublications(Archive *fout, int *numPublications)
Definition: pg_dump.c:3966
DumpId createDumpId(void)
Definition: common.c:644
TSTemplateInfo * getTSTemplates(Archive *fout, int *numTSTemplates)
Definition: pg_dump.c:9227
ProcLangInfo * getProcLangs(Archive *fout, int *numProcLangs)
Definition: pg_dump.c:8154
TypeInfo * getTypes(Archive *fout, int *numTypes)
Definition: pg_dump.c:5237
ExtensionInfo * findExtensionByOid(Oid oid)
Definition: common.c:892
void AssignDumpId(DumpableObject *dobj)
Definition: common.c:580
struct _evttriggerInfo EventTriggerInfo
void getExtendedStatistics(Archive *fout)
Definition: pg_dump.c:7382
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:18178
DumpId getMaxDumpId(void)
Definition: common.c:653
OprInfo * getOperators(Archive *fout, int *numOperators)
Definition: pg_dump.c:5492
OpclassInfo * getOpclasses(Archive *fout, int *numOpclasses)
Definition: pg_dump.c:5799
uint32 DumpComponents
Definition: pg_dump.h:89
CollInfo * getCollations(Archive *fout, int *numCollations)
Definition: pg_dump.c:5574
struct _typeInfo TypeInfo
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:4442
void sortDumpableObjects(DumpableObject **objs, int numObjs, DumpId preBoundaryId, DumpId postBoundaryId)
Definition: pg_dump_sort.c:319
struct _SubscriptionInfo SubscriptionInfo
struct _extensionInfo ExtensionInfo
struct _dictInfo TSDictInfo
struct _funcInfo FuncInfo
struct _opclassInfo OpclassInfo
struct _blobInfo BlobInfo
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition: pg_dump.c:5153
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:696
struct _statsExtInfo StatsExtInfo
CollInfo * findCollationByOid(Oid oid)
Definition: common.c:856
TSParserInfo * getTSParsers(Archive *fout, int *numTSParsers)
Definition: pg_dump.c:9054
TransformInfo * getTransforms(Archive *fout, int *numTransforms)
Definition: pg_dump.c:8461
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7819
DumpableObjectType
Definition: pg_dump.h:38
@ DO_EVENT_TRIGGER
Definition: pg_dump.h:79
@ DO_REFRESH_MATVIEW
Definition: pg_dump.h:80
@ DO_POLICY
Definition: pg_dump.h:81
@ DO_CAST
Definition: pg_dump.h:63
@ DO_FOREIGN_SERVER
Definition: pg_dump.h:72
@ DO_PRE_DATA_BOUNDARY
Definition: pg_dump.h:77
@ DO_PROCLANG
Definition: pg_dump.h:62
@ DO_TYPE
Definition: pg_dump.h:42
@ DO_INDEX
Definition: pg_dump.h:55
@ DO_COLLATION
Definition: pg_dump.h:50
@ DO_BLOB
Definition: pg_dump.h:75
@ DO_TSCONFIG
Definition: pg_dump.h:70
@ DO_OPERATOR
Definition: pg_dump.h:46
@ DO_FK_CONSTRAINT
Definition: pg_dump.h:61
@ DO_CONSTRAINT
Definition: pg_dump.h:60
@ DO_SUBSCRIPTION
Definition: pg_dump.h:85
@ DO_DEFAULT_ACL
Definition: pg_dump.h:73
@ DO_FDW
Definition: pg_dump.h:71
@ DO_SEQUENCE_SET
Definition: pg_dump.h:65
@ DO_ATTRDEF
Definition: pg_dump.h:54
@ DO_BLOB_DATA
Definition: pg_dump.h:76
@ DO_PUBLICATION_REL
Definition: pg_dump.h:83
@ DO_TABLE_ATTACH
Definition: pg_dump.h:53
@ DO_OPCLASS
Definition: pg_dump.h:48
@ DO_INDEX_ATTACH
Definition: pg_dump.h:56
@ DO_TSTEMPLATE
Definition: pg_dump.h:69
@ DO_STATSEXT
Definition: pg_dump.h:57
@ DO_FUNC
Definition: pg_dump.h:44
@ DO_POST_DATA_BOUNDARY
Definition: pg_dump.h:78
@ DO_OPFAMILY
Definition: pg_dump.h:49
@ DO_TRANSFORM
Definition: pg_dump.h:74
@ DO_ACCESS_METHOD
Definition: pg_dump.h:47
@ DO_PUBLICATION_TABLE_IN_SCHEMA
Definition: pg_dump.h:84
@ DO_CONVERSION
Definition: pg_dump.h:51
@ DO_TRIGGER
Definition: pg_dump.h:59
@ DO_RULE
Definition: pg_dump.h:58
@ DO_DUMMY_TYPE
Definition: pg_dump.h:66
@ DO_TSDICT
Definition: pg_dump.h:68
@ DO_TSPARSER
Definition: pg_dump.h:67
@ DO_EXTENSION
Definition: pg_dump.h:41
@ DO_TABLE_DATA
Definition: pg_dump.h:64
@ DO_PUBLICATION
Definition: pg_dump.h:82
@ DO_TABLE
Definition: pg_dump.h:52
@ DO_NAMESPACE
Definition: pg_dump.h:40
@ DO_AGG
Definition: pg_dump.h:45
@ DO_SHELL_TYPE
Definition: pg_dump.h:43
TypeInfo * findTypeByOid(Oid oid)
Definition: common.c:801
RuleInfo * getRules(Archive *fout, int *numRules)
Definition: pg_dump.c:7706
OprInfo * findOprByOid(Oid oid)
Definition: common.c:838
struct _PublicationRelInfo PublicationRelInfo
void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:186
AggInfo * getAggregates(Archive *fout, int *numAggregates)
Definition: pg_dump.c:5956
struct _convInfo ConvInfo
EventTriggerInfo * getEventTriggers(Archive *fout, int *numEventTriggers)
Definition: pg_dump.c:8063
struct _constraintInfo ConstraintInfo
TableInfo * getTables(Archive *fout, int *numTables)
Definition: pg_dump.c:6383
bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno)
Definition: pg_dump.c:9036
struct _tableAttachInfo TableAttachInfo
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:745
void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables)
Definition: pg_dump.c:8558
CastInfo * getCasts(Archive *fout, int *numCasts)
Definition: pg_dump.c:8335
struct _oprInfo OprInfo
PublicationInfo * findPublicationByOid(Oid oid)
Definition: common.c:910
struct _PublicationSchemaInfo PublicationSchemaInfo
unsigned int Oid
Definition: postgres_ext.h:31
bool puballtables
Definition: pg_dump.h:616
bool pubtruncate
Definition: pg_dump.h:620
DumpableObject dobj
Definition: pg_dump.h:614
char * rolname
Definition: pg_dump.h:615
TableInfo * pubtable
Definition: pg_dump.h:632
PublicationInfo * publication
Definition: pg_dump.h:631
DumpableObject dobj
Definition: pg_dump.h:630
NamespaceInfo * pubschema
Definition: pg_dump.h:643
DumpableObject dobj
Definition: pg_dump.h:641
PublicationInfo * publication
Definition: pg_dump.h:642
char * subbinary
Definition: pg_dump.h:655
char * subsynccommit
Definition: pg_dump.h:658
char * subpublications
Definition: pg_dump.h:659
char * subtwophasestate
Definition: pg_dump.h:657
char * substream
Definition: pg_dump.h:656
char * subslotname
Definition: pg_dump.h:654
char * rolname
Definition: pg_dump.h:652
char * subconninfo
Definition: pg_dump.h:653
DumpableObject dobj
Definition: pg_dump.h:651
char * amhandler
Definition: pg_dump.h:234
DumpableObject dobj
Definition: pg_dump.h:232
FuncInfo aggfn
Definition: pg_dump.h:218
DumpableObject dobj
Definition: pg_dump.h:357
char * adef_expr
Definition: pg_dump.h:360
TableInfo * adtable
Definition: pg_dump.h:358
bool separate
Definition: pg_dump.h:361
char * initrblobacl
Definition: pg_dump.h:588
DumpableObject dobj
Definition: pg_dump.h:583
char * initblobacl
Definition: pg_dump.h:587
char * blobacl
Definition: pg_dump.h:585
char * rblobacl
Definition: pg_dump.h:586
char * rolname
Definition: pg_dump.h:584
char castmethod
Definition: pg_dump.h:492
Oid casttarget
Definition: pg_dump.h:489
char castcontext
Definition: pg_dump.h:491
DumpableObject dobj
Definition: pg_dump.h:487
Oid castsource
Definition: pg_dump.h:488
Oid castfunc
Definition: pg_dump.h:490
Oid cfgparser
Definition: pg_dump.h:540
char * rolname
Definition: pg_dump.h:539
DumpableObject dobj
Definition: pg_dump.h:538
char * rolname
Definition: pg_dump.h:252
DumpableObject dobj
Definition: pg_dump.h:251
TypeInfo * condomain
Definition: pg_dump.h:460
TableInfo * contable
Definition: pg_dump.h:459
bool condeferred
Definition: pg_dump.h:466
bool conislocal
Definition: pg_dump.h:467
DumpableObject dobj
Definition: pg_dump.h:458
DumpId conindex
Definition: pg_dump.h:464
bool condeferrable
Definition: pg_dump.h:465
char * condef
Definition: pg_dump.h:462
DumpableObject dobj
Definition: pg_dump.h:257
char * rolname
Definition: pg_dump.h:258
DumpableObject dobj
Definition: pg_dump.h:572
char * defaclrole
Definition: pg_dump.h:573
char * rdefaclacl
Definition: pg_dump.h:576
char * initrdefaclacl
Definition: pg_dump.h:578
char * defaclacl
Definition: pg_dump.h:575
char * initdefaclacl
Definition: pg_dump.h:577
char defaclobjtype
Definition: pg_dump.h:574
char * rolname
Definition: pg_dump.h:524
char * dictinitoption
Definition: pg_dump.h:526
DumpableObject dobj
Definition: pg_dump.h:523
Oid dicttemplate
Definition: pg_dump.h:525
DumpComponents dump
Definition: pg_dump.h:133
char * name
Definition: pg_dump.h:132
DumpId * dependencies
Definition: pg_dump.h:138
DumpId dumpId
Definition: pg_dump.h:131
bool ext_member
Definition: pg_dump.h:136
DumpableObjectType objType
Definition: pg_dump.h:129
CatalogId catId
Definition: pg_dump.h:130
DumpComponents dump_contains
Definition: pg_dump.h:135
bool depends_on_ext
Definition: pg_dump.h:137
char * evtevent
Definition: pg_dump.h:441
char * evtfname
Definition: pg_dump.h:444
char evtenabled
Definition: pg_dump.h:445
char * evtname
Definition: pg_dump.h:440
char * evtowner
Definition: pg_dump.h:442
char * evttags
Definition: pg_dump.h:443
DumpableObject dobj
Definition: pg_dump.h:439
bool relocatable
Definition: pg_dump.h:158
char * extversion
Definition: pg_dump.h:160
DumpableObject dobj
Definition: pg_dump.h:157
char * extcondition
Definition: pg_dump.h:162
char * extconfig
Definition: pg_dump.h:161
char * fdwhandler
Definition: pg_dump.h:547
char * initfdwacl
Definition: pg_dump.h:552
char * rolname
Definition: pg_dump.h:546
char * initrfdwacl
Definition: pg_dump.h:553
char * fdwvalidator
Definition: pg_dump.h:548
char * rfdwacl
Definition: pg_dump.h:551
char * fdwoptions
Definition: pg_dump.h:549
char * fdwacl
Definition: pg_dump.h:550
DumpableObject dobj
Definition: pg_dump.h:545
char * srvoptions
Definition: pg_dump.h:567
DumpableObject dobj
Definition: pg_dump.h:558
char * initsrvacl
Definition: pg_dump.h:565
char * initrsrvacl
Definition: pg_dump.h:566
char * srvversion
Definition: pg_dump.h:562
char * proacl
Definition: pg_dump.h:209
char * rproacl
Definition: pg_dump.h:210
char * rolname
Definition: pg_dump.h:204
Oid lang
Definition: pg_dump.h:205
Oid * argtypes
Definition: pg_dump.h:207
Oid prorettype
Definition: pg_dump.h:208
DumpableObject dobj
Definition: pg_dump.h:203
char * initrproacl
Definition: pg_dump.h:212
char * initproacl
Definition: pg_dump.h:211
int nargs
Definition: pg_dump.h:206
IndxInfo * partitionIdx
Definition: pg_dump.h:397
DumpableObject dobj
Definition: pg_dump.h:395
IndxInfo * parentIdx
Definition: pg_dump.h:396
bool indisreplident
Definition: pg_dump.h:385
int indnkeyattrs
Definition: pg_dump.h:380
char * indstatvals
Definition: pg_dump.h:379
char * indstatcols
Definition: pg_dump.h:378
int indnattrs
Definition: pg_dump.h:381
TableInfo * indextable
Definition: pg_dump.h:374
Oid parentidx
Definition: pg_dump.h:386
Oid * indkeys
Definition: pg_dump.h:382
char * indreloptions
Definition: pg_dump.h:377
DumpId indexconstraint
Definition: pg_dump.h:390
bool indisclustered
Definition: pg_dump.h:384
SimplePtrList partattaches
Definition: pg_dump.h:387
char * tablespace
Definition: pg_dump.h:376
char * indexdef
Definition: pg_dump.h:375
DumpableObject dobj
Definition: pg_dump.h:373
Oid inhparent
Definition: pg_dump.h:508
Oid inhrelid
Definition: pg_dump.h:507
char * initnspacl
Definition: pg_dump.h:151
DumpableObject dobj
Definition: pg_dump.h:145
char * rolname
Definition: pg_dump.h:148
char * rnspacl
Definition: pg_dump.h:150
char * nspacl
Definition: pg_dump.h:149
char * initrnspacl
Definition: pg_dump.h:152
DumpableObject dobj
Definition: pg_dump.h:239
char * rolname
Definition: pg_dump.h:240
char * rolname
Definition: pg_dump.h:246
DumpableObject dobj
Definition: pg_dump.h:245
DumpableObject dobj
Definition: pg_dump.h:224
char oprkind
Definition: pg_dump.h:226
Oid oprcode
Definition: pg_dump.h:227
char * rolname
Definition: pg_dump.h:225
TableInfo * poltable
Definition: pg_dump.h:600
char * polqual
Definition: pg_dump.h:605
char polcmd
Definition: pg_dump.h:602
char * polroles
Definition: pg_dump.h:604
char * polwithcheck
Definition: pg_dump.h:606
DumpableObject dobj
Definition: pg_dump.h:599
bool polpermissive
Definition: pg_dump.h:603
char * polname
Definition: pg_dump.h:601
Oid lanvalidator
Definition: pg_dump.h:477
char * initrlanacl
Definition: pg_dump.h:481
DumpableObject dobj
Definition: pg_dump.h:473
char * rlanacl
Definition: pg_dump.h:479
Oid laninline
Definition: pg_dump.h:476
char * initlanacl
Definition: pg_dump.h:480
Oid lanplcallfoid
Definition: pg_dump.h:475
char * lanowner
Definition: pg_dump.h:482
bool lanpltrusted
Definition: pg_dump.h:474
char * lanacl
Definition: pg_dump.h:478
DumpableObject dobj
Definition: pg_dump.h:513
Oid prstoken
Definition: pg_dump.h:515
Oid prslextype
Definition: pg_dump.h:518
Oid prsheadline
Definition: pg_dump.h:517
Oid prsstart
Definition: pg_dump.h:514
Oid prsend
Definition: pg_dump.h:516
DumpableObject dobj
Definition: pg_dump.h:409
bool separate
Definition: pg_dump.h:414
char ev_enabled
Definition: pg_dump.h:413
bool is_instead
Definition: pg_dump.h:412
TableInfo * ruletable
Definition: pg_dump.h:410
char ev_type
Definition: pg_dump.h:411
TypeInfo * baseType
Definition: pg_dump.h:198
DumpableObject dobj
Definition: pg_dump.h:196
char * rolname
Definition: pg_dump.h:403
int stattarget
Definition: pg_dump.h:404
DumpableObject dobj
Definition: pg_dump.h:402
TableInfo * partitionTbl
Definition: pg_dump.h:352
DumpableObject dobj
Definition: pg_dump.h:350
TableInfo * parentTbl
Definition: pg_dump.h:351
TableInfo * tdtable
Definition: pg_dump.h:367
DumpableObject dobj
Definition: pg_dump.h:366
char * filtercond
Definition: pg_dump.h:368
char * relacl
Definition: pg_dump.h:268
char * partkeydef
Definition: pg_dump.h:331
char * attidentity
Definition: pg_dump.h:317
char * reltablespace
Definition: pg_dump.h:276
char * reloftype
Definition: pg_dump.h:292
int ncheck
Definition: pg_dump.h:291
bool ispartition
Definition: pg_dump.h:303
struct _indxInfo * indexes
Definition: pg_dump.h:342
bool * attislocal
Definition: pg_dump.h:321
char * rolname
Definition: pg_dump.h:267
DumpableObject dobj
Definition: pg_dump.h:266
bool is_identity_sequence
Definition: pg_dump.h:297
int numParents
Definition: pg_dump.h:339
bool interesting
Definition: pg_dump.h:300
char * toast_reloptions
Definition: pg_dump.h:279
struct _tableInfo ** parents
Definition: pg_dump.h:340
bool relispopulated
Definition: pg_dump.h:274
char * attgenerated
Definition: pg_dump.h:318
int * attlen
Definition: pg_dump.h:319
char ** attfdwoptions
Definition: pg_dump.h:325
char * partbound
Definition: pg_dump.h:332
char * rrelacl
Definition: pg_dump.h:269
bool hasoids
Definition: pg_dump.h:285
Oid toast_oid
Definition: pg_dump.h:288
Oid foreign_server
Definition: pg_dump.h:293
bool hasrules
Definition: pg_dump.h:281
struct _triggerInfo * triggers
Definition: pg_dump.h:345
bool * attisdropped
Definition: pg_dump.h:316
char * initrelacl
Definition: pg_dump.h:270
bool needs_override
Definition: pg_dump.h:333
struct _constraintInfo * checkexprs
Definition: pg_dump.h:330
int * attstattarget
Definition: pg_dump.h:313
uint32 frozenxid
Definition: pg_dump.h:286
char * typstorage
Definition: pg_dump.h:315
int owning_col
Definition: pg_dump.h:296
char * checkoption
Definition: pg_dump.h:278
int numatts
Definition: pg_dump.h:309
bool hastriggers
Definition: pg_dump.h:282
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:329
char ** attoptions
Definition: pg_dump.h:322
char relreplident
Definition: pg_dump.h:275
int numTriggers
Definition: pg_dump.h:344
uint32 minmxid
Definition: pg_dump.h:287
Oid * attcollation
Definition: pg_dump.h:323
char * attstorage
Definition: pg_dump.h:314
bool * notnull
Definition: pg_dump.h:327
Oid owning_tab
Definition: pg_dump.h:295
struct _tableDataInfo * dataObj
Definition: pg_dump.h:343
char * amname
Definition: pg_dump.h:334
bool dummy_view
Definition: pg_dump.h:301
bool forcerowsec
Definition: pg_dump.h:284
char ** atttypnames
Definition: pg_dump.h:311
char ** attmissingval
Definition: pg_dump.h:326
char relpersistence
Definition: pg_dump.h:273
char ** attnames
Definition: pg_dump.h:310
char relkind
Definition: pg_dump.h:272
bool hasindex
Definition: pg_dump.h:280
char * reloptions
Definition: pg_dump.h:277
int numIndexes
Definition: pg_dump.h:341
int relpages
Definition: pg_dump.h:298
uint32 toast_frozenxid
Definition: pg_dump.h:289
uint32 toast_minmxid
Definition: pg_dump.h:290
char * attalign
Definition: pg_dump.h:320
char * attcompression
Definition: pg_dump.h:324
int * atttypmod
Definition: pg_dump.h:312
bool postponed_def
Definition: pg_dump.h:302
bool rowsec
Definition: pg_dump.h:283
bool * inhNotNull
Definition: pg_dump.h:328
char * initrrelacl
Definition: pg_dump.h:271
Oid tmpllexize
Definition: pg_dump.h:533
Oid tmplinit
Definition: pg_dump.h:532
DumpableObject dobj
Definition: pg_dump.h:531
DumpableObject dobj
Definition: pg_dump.h:497
Oid trffromsql
Definition: pg_dump.h:500
int tgtype
Definition: pg_dump.h:423
TableInfo * tgtable
Definition: pg_dump.h:421
bool tgdeferrable
Definition: pg_dump.h:432
DumpableObject dobj
Definition: pg_dump.h:420
bool tgisinternal
Definition: pg_dump.h:431
char * tgconstrname
Definition: pg_dump.h:427
int tgnargs
Definition: pg_dump.h:424
char tgenabled
Definition: pg_dump.h:430
Oid tgconstrrelid
Definition: pg_dump.h:428
char * tgdef
Definition: pg_dump.h:434
char * tgfname
Definition: pg_dump.h:422
char * tgargs
Definition: pg_dump.h:425
bool tgisconstraint
Definition: pg_dump.h:426
bool tginitdeferred
Definition: pg_dump.h:433
char * tgconstrrelname
Definition: pg_dump.h:429
bool isMultirange
Definition: pg_dump.h:185
char * initrtypacl
Definition: pg_dump.h:179
struct _constraintInfo * domChecks
Definition: pg_dump.h:191
DumpableObject dobj
Definition: pg_dump.h:167
bool isDefined
Definition: pg_dump.h:186
char * rtypacl
Definition: pg_dump.h:177
char * ftypname
Definition: pg_dump.h:174
char * inittypacl
Definition: pg_dump.h:178
char typrelkind
Definition: pg_dump.h:182
Oid typelem
Definition: pg_dump.h:180
char * typacl
Definition: pg_dump.h:176
struct _shellTypeInfo * shellType
Definition: pg_dump.h:188
int nDomChecks
Definition: pg_dump.h:190
char typtype
Definition: pg_dump.h:183
Oid typrelid
Definition: pg_dump.h:181
bool isArray
Definition: pg_dump.h:184
char * rolname
Definition: pg_dump.h:175