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-2020, 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! */
60  DO_FK_CONSTRAINT, /* see note for ConstraintInfo */
85 
86 /* component types of an object which can be selected for dumping */
87 typedef uint32 DumpComponents; /* a bitmask of dump object components */
88 #define DUMP_COMPONENT_NONE (0)
89 #define DUMP_COMPONENT_DEFINITION (1 << 0)
90 #define DUMP_COMPONENT_DATA (1 << 1)
91 #define DUMP_COMPONENT_COMMENT (1 << 2)
92 #define DUMP_COMPONENT_SECLABEL (1 << 3)
93 #define DUMP_COMPONENT_ACL (1 << 4)
94 #define DUMP_COMPONENT_POLICY (1 << 5)
95 #define DUMP_COMPONENT_USERMAP (1 << 6)
96 #define DUMP_COMPONENT_ALL (0xFFFF)
97 
98 /*
99  * component types which require us to obtain a lock on the table
100  *
101  * Note that some components only require looking at the information
102  * in the pg_catalog tables and, for those components, we do not need
103  * to lock the table. Be careful here though- some components use
104  * server-side functions which pull the latest information from
105  * SysCache and in those cases we *do* need to lock the table.
106  *
107  * We do not need locks for the COMMENT and SECLABEL components as
108  * those simply query their associated tables without using any
109  * server-side functions. We do not need locks for the ACL component
110  * as we pull that information from pg_class without using any
111  * server-side functions that use SysCache. The USERMAP component
112  * is only relevant for FOREIGN SERVERs and not tables, so no sense
113  * locking a table for that either (that can happen if we are going
114  * to dump "ALL" components for a table).
115  *
116  * We DO need locks for DEFINITION, due to various server-side
117  * functions that are used and POLICY due to pg_get_expr(). We set
118  * this up to grab the lock except in the cases we know to be safe.
119  */
120 #define DUMP_COMPONENTS_REQUIRING_LOCK (\
121  DUMP_COMPONENT_DEFINITION |\
122  DUMP_COMPONENT_DATA |\
123  DUMP_COMPONENT_POLICY)
124 
125 typedef struct _dumpableObject
126 {
128  CatalogId catId; /* zero if not a cataloged object */
129  DumpId dumpId; /* assigned by AssignDumpId() */
130  char *name; /* object name (should never be NULL) */
131  struct _namespaceInfo *namespace; /* containing namespace, or NULL */
132  DumpComponents dump; /* bitmask of components to dump */
133  DumpComponents dump_contains; /* as above, but for contained objects */
134  bool ext_member; /* true if object is member of extension */
135  bool depends_on_ext; /* true if object depends on an extension */
136  DumpId *dependencies; /* dumpIds of objects this one depends on */
137  int nDeps; /* number of valid dependencies */
138  int allocDeps; /* allocated size of dependencies[] */
140 
141 typedef struct _namespaceInfo
142 {
144  char *rolname; /* name of owner, or empty string */
145  char *nspacl;
146  char *rnspacl;
147  char *initnspacl;
148  char *initrnspacl;
149 } NamespaceInfo;
150 
151 typedef struct _extensionInfo
152 {
154  char *namespace; /* schema containing extension's objects */
155  bool relocatable;
156  char *extversion;
157  char *extconfig; /* info about configuration tables */
159 } ExtensionInfo;
160 
161 typedef struct _typeInfo
162 {
164 
165  /*
166  * Note: dobj.name is the pg_type.typname entry. format_type() might
167  * produce something different than typname
168  */
169  char *rolname; /* name of owner, or empty string */
170  char *typacl;
171  char *rtypacl;
172  char *inittypacl;
173  char *initrtypacl;
176  char typrelkind; /* 'r', 'v', 'c', etc */
177  char typtype; /* 'b', 'c', etc */
178  bool isArray; /* true if auto-generated array type */
179  bool isDefined; /* true if typisdefined */
180  /* If needed, we'll create a "shell type" entry for it; link that here: */
181  struct _shellTypeInfo *shellType; /* shell-type entry, or NULL */
182  /* If it's a domain, we store links to its constraints here: */
185 } TypeInfo;
186 
187 typedef struct _shellTypeInfo
188 {
190 
191  TypeInfo *baseType; /* back link to associated base type */
192 } ShellTypeInfo;
193 
194 typedef struct _funcInfo
195 {
197  char *rolname; /* name of owner, or empty string */
199  int nargs;
202  char *proacl;
203  char *rproacl;
204  char *initproacl;
205  char *initrproacl;
206 } FuncInfo;
207 
208 /* AggInfo is a superset of FuncInfo */
209 typedef struct _aggInfo
210 {
212  /* we don't require any other fields at the moment */
213 } AggInfo;
214 
215 typedef struct _oprInfo
216 {
218  char *rolname;
219  char oprkind;
221 } OprInfo;
222 
223 typedef struct _accessMethodInfo
224 {
226  char amtype;
227  char *amhandler;
229 
230 typedef struct _opclassInfo
231 {
233  char *rolname;
234 } OpclassInfo;
235 
236 typedef struct _opfamilyInfo
237 {
239  char *rolname;
240 } OpfamilyInfo;
241 
242 typedef struct _collInfo
243 {
245  char *rolname;
246 } CollInfo;
247 
248 typedef struct _convInfo
249 {
251  char *rolname;
252 } ConvInfo;
253 
254 typedef struct _tableInfo
255 {
256  /*
257  * These fields are collected for every table in the database.
258  */
260  char *rolname; /* name of owner, or empty string */
261  char *relacl;
262  char *rrelacl;
263  char *initrelacl;
264  char *initrrelacl;
265  char relkind;
266  char relpersistence; /* relation persistence */
267  bool relispopulated; /* relation is populated */
268  char relreplident; /* replica identifier */
269  char *reltablespace; /* relation tablespace */
270  char *reloptions; /* options specified by WITH (...) */
271  char *checkoption; /* WITH CHECK OPTION, if any */
272  char *toast_reloptions; /* WITH options for the TOAST table */
273  bool hasindex; /* does it have any indexes? */
274  bool hasrules; /* does it have any rules? */
275  bool hastriggers; /* does it have any triggers? */
276  bool rowsec; /* is row security enabled? */
277  bool forcerowsec; /* is row security forced? */
278  bool hasoids; /* does it have OIDs? */
279  uint32 frozenxid; /* table's relfrozenxid */
280  uint32 minmxid; /* table's relminmxid */
281  Oid toast_oid; /* toast table's OID, or 0 if none */
282  uint32 toast_frozenxid; /* toast table's relfrozenxid, if any */
283  uint32 toast_minmxid; /* toast table's relminmxid */
284  int ncheck; /* # of CHECK expressions */
285  char *reloftype; /* underlying type for typed table */
286  Oid foreign_server; /* foreign server oid, if applicable */
287  /* these two are set only if table is a sequence owned by a column: */
288  Oid owning_tab; /* OID of table owning sequence */
289  int owning_col; /* attr # of column owning sequence */
291  int relpages; /* table's size in pages (from pg_class) */
292 
293  bool interesting; /* true if need to collect more data */
294  bool dummy_view; /* view's real definition must be postponed */
295  bool postponed_def; /* matview must be postponed into post-data */
296  bool ispartition; /* is table a partition? */
297 
298  /*
299  * These fields are computed only if we decide the table is interesting
300  * (it's either a table to dump, or a direct parent of a dumpable table).
301  */
302  int numatts; /* number of attributes */
303  char **attnames; /* the attribute names */
304  char **atttypnames; /* attribute type names */
305  int *atttypmod; /* type-specific type modifiers */
306  int *attstattarget; /* attribute statistics targets */
307  char *attstorage; /* attribute storage scheme */
308  char *typstorage; /* type storage scheme */
309  bool *attisdropped; /* true if attr is dropped; don't dump it */
310  char *attidentity;
312  int *attlen; /* attribute length, used by binary_upgrade */
313  char *attalign; /* attribute align, used by binary_upgrade */
314  bool *attislocal; /* true if attr has local definition */
315  char **attoptions; /* per-attribute options */
316  Oid *attcollation; /* per-attribute collation selection */
317  char **attfdwoptions; /* per-attribute fdw options */
318  char **attmissingval; /* per attribute missing value */
319  bool *notnull; /* NOT NULL constraints on attributes */
320  bool *inhNotNull; /* true if NOT NULL is inherited */
321  struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
322  struct _constraintInfo *checkexprs; /* CHECK constraints */
323  char *partkeydef; /* partition key definition */
324  char *partbound; /* partition bound definition */
325  bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
326  char *amname; /* relation access method */
327 
328  /*
329  * Stuff computed only for dumpable tables.
330  */
331  int numParents; /* number of (immediate) parent tables */
332  struct _tableInfo **parents; /* TableInfos of immediate parents */
333  int numIndexes; /* number of indexes */
334  struct _indxInfo *indexes; /* indexes */
335  struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
336  int numTriggers; /* number of triggers for table */
337  struct _triggerInfo *triggers; /* array of TriggerInfo structs */
338 } TableInfo;
339 
340 typedef struct _attrDefInfo
341 {
342  DumpableObject dobj; /* note: dobj.name is name of table */
343  TableInfo *adtable; /* link to table of attribute */
344  int adnum;
345  char *adef_expr; /* decompiled DEFAULT expression */
346  bool separate; /* true if must dump as separate item */
347 } AttrDefInfo;
348 
349 typedef struct _tableDataInfo
350 {
352  TableInfo *tdtable; /* link to table to dump */
353  char *filtercond; /* WHERE condition to limit rows dumped */
354 } TableDataInfo;
355 
356 typedef struct _indxInfo
357 {
359  TableInfo *indextable; /* link to table the index is for */
360  char *indexdef;
361  char *tablespace; /* tablespace in which index is stored */
362  char *indreloptions; /* options specified by WITH (...) */
363  char *indstatcols; /* column numbers with statistics */
364  char *indstatvals; /* statistic values for columns */
365  int indnkeyattrs; /* number of index key attributes */
366  int indnattrs; /* total number of index attributes */
367  Oid *indkeys; /* In spite of the name 'indkeys' this field
368  * contains both key and nonkey attributes */
371  Oid parentidx; /* if partitioned, parent index OID */
372  SimplePtrList partattaches; /* if partitioned, partition attach objects */
373 
374  /* if there is an associated constraint object, its dumpId: */
376 } IndxInfo;
377 
378 typedef struct _indexAttachInfo
379 {
381  IndxInfo *parentIdx; /* link to index on partitioned table */
382  IndxInfo *partitionIdx; /* link to index on partition */
384 
385 typedef struct _statsExtInfo
386 {
388  char *rolname; /* name of owner, or empty string */
389  int stattarget; /* statistics target */
390 } StatsExtInfo;
391 
392 typedef struct _ruleInfo
393 {
395  TableInfo *ruletable; /* link to table the rule is for */
396  char ev_type;
399  bool separate; /* true if must dump as separate item */
400  /* separate is always true for non-ON SELECT rules */
401 } RuleInfo;
402 
403 typedef struct _triggerInfo
404 {
406  TableInfo *tgtable; /* link to table the trigger is for */
407  char *tgfname;
408  int tgtype;
409  int tgnargs;
410  char *tgargs;
415  char tgenabled;
418  char *tgdef;
419 } TriggerInfo;
420 
421 typedef struct _evttriggerInfo
422 {
424  char *evtname;
425  char *evtevent;
426  char *evtowner;
427  char *evttags;
428  char *evtfname;
431 
432 /*
433  * struct ConstraintInfo is used for all constraint types. However we
434  * use a different objType for foreign key constraints, to make it easier
435  * to sort them the way we want.
436  *
437  * Note: condeferrable and condeferred are currently only valid for
438  * unique/primary-key constraints. Otherwise that info is in condef.
439  */
440 typedef struct _constraintInfo
441 {
443  TableInfo *contable; /* NULL if domain constraint */
444  TypeInfo *condomain; /* NULL if table constraint */
445  char contype;
446  char *condef; /* definition, if CHECK or FOREIGN KEY */
447  Oid confrelid; /* referenced table, if FOREIGN KEY */
448  DumpId conindex; /* identifies associated index if any */
449  bool condeferrable; /* true if constraint is DEFERRABLE */
450  bool condeferred; /* true if constraint is INITIALLY DEFERRED */
451  bool conislocal; /* true if constraint has local definition */
452  bool separate; /* true if must dump as separate item */
454 
455 typedef struct _procLangInfo
456 {
462  char *lanacl;
463  char *rlanacl;
464  char *initlanacl;
465  char *initrlanacl;
466  char *lanowner; /* name of owner, or empty string */
467 } ProcLangInfo;
468 
469 typedef struct _castInfo
470 {
477 } CastInfo;
478 
479 typedef struct _transformInfo
480 {
486 } TransformInfo;
487 
488 /* InhInfo isn't a DumpableObject, just temporary state */
489 typedef struct _inhInfo
490 {
491  Oid inhrelid; /* OID of a child table */
492  Oid inhparent; /* OID of its parent */
493 } InhInfo;
494 
495 typedef struct _prsInfo
496 {
503 } TSParserInfo;
504 
505 typedef struct _dictInfo
506 {
508  char *rolname;
511 } TSDictInfo;
512 
513 typedef struct _tmplInfo
514 {
519 
520 typedef struct _cfgInfo
521 {
523  char *rolname;
525 } TSConfigInfo;
526 
527 typedef struct _fdwInfo
528 {
530  char *rolname;
531  char *fdwhandler;
533  char *fdwoptions;
534  char *fdwacl;
535  char *rfdwacl;
536  char *initfdwacl;
537  char *initrfdwacl;
538 } FdwInfo;
539 
540 typedef struct _foreignServerInfo
541 {
543  char *rolname;
545  char *srvtype;
546  char *srvversion;
547  char *srvacl;
548  char *rsrvacl;
549  char *initsrvacl;
550  char *initrsrvacl;
551  char *srvoptions;
553 
554 typedef struct _defaultACLInfo
555 {
557  char *defaclrole;
559  char *defaclacl;
560  char *rdefaclacl;
564 
565 typedef struct _blobInfo
566 {
568  char *rolname;
569  char *blobacl;
570  char *rblobacl;
571  char *initblobacl;
573 } BlobInfo;
574 
575 /*
576  * The PolicyInfo struct is used to represent policies on a table and
577  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
578  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
579  * it's non-NULL then this is a regular policy definition.
580  */
581 typedef struct _policyInfo
582 {
585  char *polname; /* null indicates RLS is enabled on rel */
586  char polcmd;
588  char *polroles;
589  char *polqual;
591 } PolicyInfo;
592 
593 /*
594  * The PublicationInfo struct is used to represent publications.
595  */
596 typedef struct _PublicationInfo
597 {
599  char *rolname;
601  bool pubinsert;
602  bool pubupdate;
603  bool pubdelete;
607 
608 /*
609  * The PublicationRelInfo struct is used to represent publication table
610  * mapping.
611  */
612 typedef struct _PublicationRelInfo
613 {
616  char *pubname;
618 
619 /*
620  * The SubscriptionInfo struct is used to represent subscription.
621  */
622 typedef struct _SubscriptionInfo
623 {
625  char *rolname;
626  char *subconninfo;
627  char *subslotname;
631 
632 /*
633  * We build an array of these with an entry for each object that is an
634  * extension member according to pg_depend.
635  */
636 typedef struct _extensionMemberId
637 {
638  CatalogId catId; /* tableoid+oid of some member object */
639  ExtensionInfo *ext; /* owning extension */
641 
642 /*
643  * common utility functions
644  */
645 
646 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
647 
648 extern void AssignDumpId(DumpableObject *dobj);
649 extern DumpId createDumpId(void);
650 extern DumpId getMaxDumpId(void);
653 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
654 
655 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
656 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
657 
658 extern TableInfo *findTableByOid(Oid oid);
659 extern TypeInfo *findTypeByOid(Oid oid);
660 extern FuncInfo *findFuncByOid(Oid oid);
661 extern OprInfo *findOprByOid(Oid oid);
662 extern CollInfo *findCollationByOid(Oid oid);
665 
666 extern void setExtensionMembership(ExtensionMemberId *extmems, int nextmems);
667 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
668 
669 extern void parseOidArray(const char *str, Oid *array, int arraysize);
670 
671 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
672  DumpId preBoundaryId, DumpId postBoundaryId);
673 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
674 
675 /*
676  * version specific routines
677  */
678 extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
679 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
680 extern TypeInfo *getTypes(Archive *fout, int *numTypes);
681 extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
682 extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
683 extern OprInfo *getOperators(Archive *fout, int *numOperators);
684 extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
685 extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
686 extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
687 extern CollInfo *getCollations(Archive *fout, int *numCollations);
688 extern ConvInfo *getConversions(Archive *fout, int *numConversions);
689 extern TableInfo *getTables(Archive *fout, int *numTables);
690 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
691 extern InhInfo *getInherits(Archive *fout, int *numInherits);
692 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
693 extern void getExtendedStatistics(Archive *fout);
694 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
695 extern RuleInfo *getRules(Archive *fout, int *numRules);
696 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
697 extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
698 extern CastInfo *getCasts(Archive *fout, int *numCasts);
699 extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
700 extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
701 extern bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno);
702 extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
703 extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
704 extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
705 extern TSConfigInfo *getTSConfigurations(Archive *fout, int *numTSConfigs);
707  int *numForeignDataWrappers);
709  int *numForeignServers);
710 extern DefaultACLInfo *getDefaultACLs(Archive *fout, int *numDefaultACLs);
711 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
712  int numExtensions);
713 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
714  int numExtensions);
715 extern EventTriggerInfo *getEventTriggers(Archive *fout, int *numEventTriggers);
716 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
717 extern void getPublications(Archive *fout);
718 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
719  int numTables);
720 extern void getSubscriptions(Archive *fout);
721 
722 #endif /* PG_DUMP_H */
Oid * argtypes
Definition: pg_dump.h:200
DumpableObject dobj
Definition: pg_dump.h:624
TSConfigInfo * getTSConfigurations(Archive *fout, int *numTSConfigs)
Definition: pg_dump.c:9140
char * tgdef
Definition: pg_dump.h:418
void getExtendedStatistics(Archive *fout)
Definition: pg_dump.c:7344
char * srvoptions
Definition: pg_dump.h:551
static int numTypes
Definition: common.c:56
char * tablespace
Definition: pg_dump.h:361
char * name
Definition: pg_dump.h:130
struct _PublicationInfo PublicationInfo
ExtensionInfo * ext
Definition: pg_dump.h:639
DumpableObject dobj
Definition: pg_dump.h:238
int DumpId
Definition: pg_backup.h:234
void getPublications(Archive *fout)
Definition: pg_dump.c:3848
struct _tableInfo ** parents
Definition: pg_dump.h:332
DumpableObject dobj
Definition: pg_dump.h:217
char * evtevent
Definition: pg_dump.h:425
ForeignServerInfo * getForeignServers(Archive *fout, int *numForeignServers)
Definition: pg_dump.c:9383
DumpableObject dobj
Definition: pg_dump.h:153
struct _accessMethodInfo AccessMethodInfo
int * atttypmod
Definition: pg_dump.h:305
Oid castsource
Definition: pg_dump.h:472
DumpableObject dobj
Definition: pg_dump.h:189
Oid tmplinit
Definition: pg_dump.h:516
char * reltablespace
Definition: pg_dump.h:269
char * reloptions
Definition: pg_dump.h:270
char relkind
Definition: pg_dump.h:265
char * rfdwacl
Definition: pg_dump.h:535
DumpComponents dump
Definition: pg_dump.h:131
char * fdwhandler
Definition: pg_dump.h:531
struct _constraintInfo * domChecks
Definition: pg_dump.h:184
DumpId * dependencies
Definition: pg_dump.h:136
TSParserInfo * getTSParsers(Archive *fout, int *numTSParsers)
Definition: pg_dump.c:8889
DumpableObject dobj
Definition: pg_dump.h:598
TableInfo * tdtable
Definition: pg_dump.h:352
struct _inhInfo InhInfo
char * polwithcheck
Definition: pg_dump.h:590
bool isArray
Definition: pg_dump.h:178
ConvInfo * getConversions(Archive *fout, int *numConversions)
Definition: pg_dump.c:5309
char * initlanacl
Definition: pg_dump.h:464
char * inittypacl
Definition: pg_dump.h:172
int nargs
Definition: pg_dump.h:199
struct _namespaceInfo NamespaceInfo
char * partkeydef
Definition: pg_dump.h:323
struct _indexAttachInfo IndexAttachInfo
Oid toast_oid
Definition: pg_dump.h:281
Oid typrelid
Definition: pg_dump.h:175
char * initrlanacl
Definition: pg_dump.h:465
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:18000
char * subsynccommit
Definition: pg_dump.h:628
Oid tmpllexize
Definition: pg_dump.h:517
static int numFuncs
Definition: common.c:57
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7422
bool separate
Definition: pg_dump.h:399
TSTemplateInfo * getTSTemplates(Archive *fout, int *numTSTemplates)
Definition: pg_dump.c:9064
char * initrtypacl
Definition: pg_dump.h:173
void parseOidArray(const char *str, Oid *array, int arraysize)
Definition: common.c:1049
DumpableObject dobj
Definition: pg_dump.h:387
char * rdefaclacl
Definition: pg_dump.h:560
char * rolname
Definition: pg_dump.h:260
struct _shellTypeInfo * shellType
Definition: pg_dump.h:181
TSDictInfo * getTSDictionaries(Archive *fout, int *numTSDicts)
Definition: pg_dump.c:8980
bool hastriggers
Definition: pg_dump.h:275
TypeInfo * getTypes(Archive *fout, int *numTypes)
Definition: pg_dump.c:4896
char * partbound
Definition: pg_dump.h:324
char * initrproacl
Definition: pg_dump.h:205
Oid lang
Definition: pg_dump.h:198
char typrelkind
Definition: pg_dump.h:176
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3573
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7758
char * attstorage
Definition: pg_dump.h:307
DumpableObject dobj
Definition: pg_dump.h:225
DumpableObject dobj
Definition: pg_dump.h:196
EventTriggerInfo * getEventTriggers(Archive *fout, int *numEventTriggers)
Definition: pg_dump.c:7952
char * rolname
Definition: pg_dump.h:251
bool * inhNotNull
Definition: pg_dump.h:320
int stattarget
Definition: pg_dump.h:389
char ** attmissingval
Definition: pg_dump.h:318
bool hasindex
Definition: pg_dump.h:273
char * typacl
Definition: pg_dump.h:170
char ** atttypnames
Definition: pg_dump.h:304
bool forcerowsec
Definition: pg_dump.h:277
bool is_identity_sequence
Definition: pg_dump.h:290
bool tgdeferrable
Definition: pg_dump.h:416
struct _foreignServerInfo ForeignServerInfo
struct _transformInfo TransformInfo
static int numTables
Definition: common.c:55
DumpId dumpId
Definition: pg_dump.h:129
Oid dicttemplate
Definition: pg_dump.h:509
DumpableObject dobj
Definition: pg_dump.h:457
bool hasrules
Definition: pg_dump.h:274
unsigned int Oid
Definition: postgres_ext.h:31
OprInfo * findOprByOid(Oid oid)
Definition: common.c:862
char * fdwoptions
Definition: pg_dump.h:533
DumpId conindex
Definition: pg_dump.h:448
bool lanpltrusted
Definition: pg_dump.h:458
DumpId indexconstraint
Definition: pg_dump.h:375
char ** attnames
Definition: pg_dump.h:303
Oid castfunc
Definition: pg_dump.h:474
uint32 toast_minmxid
Definition: pg_dump.h:283
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:4046
char * polqual
Definition: pg_dump.h:589
char * indexdef
Definition: pg_dump.h:360
DumpableObject dobj
Definition: pg_dump.h:259
int owning_col
Definition: pg_dump.h:289
char * attalign
Definition: pg_dump.h:313
bool ext_member
Definition: pg_dump.h:134
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17895
TableInfo * tgtable
Definition: pg_dump.h:406
bool hasoids
Definition: pg_dump.h:278
char * initblobacl
Definition: pg_dump.h:571
Oid cfgparser
Definition: pg_dump.h:524
TableInfo * findTableByOid(Oid oid)
Definition: common.c:829
char * initrsrvacl
Definition: pg_dump.h:550
char * subslotname
Definition: pg_dump.h:627
Oid parentidx
Definition: pg_dump.h:371
DumpableObject dobj
Definition: pg_dump.h:515
TableInfo * pubtable
Definition: pg_dump.h:615
struct _attrDefInfo AttrDefInfo
DumpableObjectType
Definition: pg_dump.h:37
char * condef
Definition: pg_dump.h:446
char * rnspacl
Definition: pg_dump.h:146
uint32 DumpComponents
Definition: pg_dump.h:87
DumpableObject dobj
Definition: pg_dump.h:244
char * rolname
Definition: pg_dump.h:523
char * rolname
Definition: pg_dump.h:233
FdwInfo * getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
Definition: pg_dump.c:9217
struct _blobInfo BlobInfo
bool indisreplident
Definition: pg_dump.h:370
FuncInfo aggfn
Definition: pg_dump.h:211
char * rolname
Definition: pg_dump.h:245
TransformInfo * getTransforms(Archive *fout, int *numTransforms)
Definition: pg_dump.c:8334
struct _cfgInfo TSConfigInfo
DumpableObject dobj
Definition: pg_dump.h:380
Oid * attcollation
Definition: pg_dump.h:316
char relpersistence
Definition: pg_dump.h:266
DumpableObject dobj
Definition: pg_dump.h:529
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition: common.c:628
Oid owning_tab
Definition: pg_dump.h:288
bool rowsec
Definition: pg_dump.h:276
struct _oprInfo OprInfo
void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables)
Definition: pg_dump.c:8431
struct _tmplInfo TSTemplateInfo
AccessMethodInfo * getAccessMethods(Archive *fout, int *numAccessMethods)
Definition: pg_dump.c:5382
int * attlen
Definition: pg_dump.h:312
char * rolname
Definition: pg_dump.h:508
bool separate
Definition: pg_dump.h:346
char * attidentity
Definition: pg_dump.h:310
DumpableObject dobj
Definition: pg_dump.h:442
DumpableObject dobj
Definition: pg_dump.h:567
Definition: pg_dump.h:45
struct _triggerInfo TriggerInfo
char * subconninfo
Definition: pg_dump.h:626
struct _opclassInfo OpclassInfo
DumpableObject dobj
Definition: pg_dump.h:471
Oid casttarget
Definition: pg_dump.h:473
char relreplident
Definition: pg_dump.h:268
struct _convInfo ConvInfo
bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno)
Definition: pg_dump.c:8871
static int numOperators
Definition: common.c:58
FuncInfo * getFuncs(Archive *fout, int *numFuncs)
Definition: pg_dump.c:5809
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:809
struct _PublicationRelInfo PublicationRelInfo
struct _SubscriptionInfo SubscriptionInfo
Oid prsend
Definition: pg_dump.h:500
TableInfo * indextable
Definition: pg_dump.h:359
int relpages
Definition: pg_dump.h:291
OpclassInfo * getOpclasses(Archive *fout, int *numOpclasses)
Definition: pg_dump.c:5456
char * rrelacl
Definition: pg_dump.h:262
char * extconfig
Definition: pg_dump.h:157
char * rolname
Definition: pg_dump.h:144
char * rolname
Definition: pg_dump.h:599
Oid * indkeys
Definition: pg_dump.h:367
char * rolname
Definition: pg_dump.h:568
struct _ruleInfo RuleInfo
char * filtercond
Definition: pg_dump.h:353
bool pubtruncate
Definition: pg_dump.h:604
DumpableObject dobj
Definition: pg_dump.h:522
struct _fdwInfo FdwInfo
struct _extensionMemberId ExtensionMemberId
struct _procLangInfo ProcLangInfo
IndxInfo * partitionIdx
Definition: pg_dump.h:382
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:884
TypeInfo * findTypeByOid(Oid oid)
Definition: common.c:840
int tgnargs
Definition: pg_dump.h:409
char * fdwvalidator
Definition: pg_dump.h:532
Oid lanplcallfoid
Definition: pg_dump.h:459
char * initnspacl
Definition: pg_dump.h:147
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition: common.c:87
char * evtowner
Definition: pg_dump.h:426
struct _collInfo CollInfo
Oid inhrelid
Definition: pg_dump.h:491
bool * attisdropped
Definition: pg_dump.h:309
static int numExtensions
Definition: common.c:61
bool needs_override
Definition: pg_dump.h:325
unsigned int uint32
Definition: c.h:367
int tgtype
Definition: pg_dump.h:408
DumpableObject dobj
Definition: pg_dump.h:556
Oid trffromsql
Definition: pg_dump.h:484
char * rolname
Definition: pg_dump.h:625
DumpComponents dump_contains
Definition: pg_dump.h:133
DumpableObject * findObjectByDumpId(DumpId dumpId)
Definition: common.c:610
TableInfo * adtable
Definition: pg_dump.h:343
TableInfo * poltable
Definition: pg_dump.h:584
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:760
bool is_instead
Definition: pg_dump.h:397
struct _funcInfo FuncInfo
int numTriggers
Definition: pg_dump.h:336
static int numNamespaces
Definition: common.c:60
char * relacl
Definition: pg_dump.h:261
struct _tableDataInfo TableDataInfo
struct _shellTypeInfo ShellTypeInfo
struct _aggInfo AggInfo
Oid typelem
Definition: pg_dump.h:174
char * fdwacl
Definition: pg_dump.h:534
char ev_type
Definition: pg_dump.h:396
void AssignDumpId(DumpableObject *dobj)
Definition: common.c:545
uint32 frozenxid
Definition: pg_dump.h:279
DumpId createDumpId(void)
Definition: common.c:590
bool condeferrable
Definition: pg_dump.h:449
char * tgconstrrelname
Definition: pg_dump.h:414
char * tgconstrname
Definition: pg_dump.h:412
char * subpublications
Definition: pg_dump.h:629
char * rlanacl
Definition: pg_dump.h:463
char * srvversion
Definition: pg_dump.h:546
bool tginitdeferred
Definition: pg_dump.h:417
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition: pg_dump.c:4812
char * initrrelacl
Definition: pg_dump.h:264
char * rolname
Definition: pg_dump.h:218
int * attstattarget
Definition: pg_dump.h:306
struct _defaultACLInfo DefaultACLInfo
CastInfo * getCasts(Archive *fout, int *numCasts)
Definition: pg_dump.c:8221
void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:124
int numatts
Definition: pg_dump.h:302
char * indreloptions
Definition: pg_dump.h:362
DumpableObject dobj
Definition: pg_dump.h:163
TypeInfo * condomain
Definition: pg_dump.h:444
struct _prsInfo TSParserInfo
char * rolname
Definition: pg_dump.h:388
bool postponed_def
Definition: pg_dump.h:295
bool conislocal
Definition: pg_dump.h:451
char * dictinitoption
Definition: pg_dump.h:510
struct _evttriggerInfo EventTriggerInfo
Oid lanvalidator
Definition: pg_dump.h:461
char * evtfname
Definition: pg_dump.h:428
SimplePtrList partattaches
Definition: pg_dump.h:372
char * rolname
Definition: pg_dump.h:530
char tgenabled
Definition: pg_dump.h:415
char * defaclacl
Definition: pg_dump.h:559
Oid laninline
Definition: pg_dump.h:460
struct _tableDataInfo * dataObj
Definition: pg_dump.h:335
char * evttags
Definition: pg_dump.h:427
bool tgisconstraint
Definition: pg_dump.h:411
int numIndexes
Definition: pg_dump.h:333
struct _opfamilyInfo OpfamilyInfo
char * evtname
Definition: pg_dump.h:424
DumpableObject dobj
Definition: pg_dump.h:232
char typtype
Definition: pg_dump.h:177
TableInfo * contable
Definition: pg_dump.h:443
ProcLangInfo * getProcLangs(Archive *fout, int *numProcLangs)
Definition: pg_dump.c:8043
char * lanacl
Definition: pg_dump.h:462
DumpableObject dobj
Definition: pg_dump.h:351
char * lanowner
Definition: pg_dump.h:466
int nDomChecks
Definition: pg_dump.h:183
char polcmd
Definition: pg_dump.h:586
struct _indxInfo IndxInfo
Oid foreign_server
Definition: pg_dump.h:286
bool depends_on_ext
Definition: pg_dump.h:135
bool * notnull
Definition: pg_dump.h:319
char * toast_reloptions
Definition: pg_dump.h:272
DumpableObject dobj
Definition: pg_dump.h:342
bool puballtables
Definition: pg_dump.h:600
struct _dumpableObject DumpableObject
struct _statsExtInfo StatsExtInfo
Oid prstoken
Definition: pg_dump.h:499
int ncheck
Definition: pg_dump.h:284
Oid prsstart
Definition: pg_dump.h:498
char * initfdwacl
Definition: pg_dump.h:536
char ** attoptions
Definition: pg_dump.h:315
uint32 toast_frozenxid
Definition: pg_dump.h:282
void sortDumpableObjects(DumpableObject **objs, int numObjs, DumpId preBoundaryId, DumpId postBoundaryId)
Definition: pg_dump_sort.c:257
TableInfo * ruletable
Definition: pg_dump.h:395
char oprkind
Definition: pg_dump.h:219
bool condeferred
Definition: pg_dump.h:450
Definition: pg_dump.h:70
bool ispartition
Definition: pg_dump.h:296
char * extcondition
Definition: pg_dump.h:158
struct _constraintInfo ConstraintInfo
Oid prorettype
Definition: pg_dump.h:201
void setExtensionMembership(ExtensionMemberId *extmems, int nextmems)
Definition: common.c:918
DefaultACLInfo * getDefaultACLs(Archive *fout, int *numDefaultACLs)
Definition: pg_dump.c:9533
char * rtypacl
Definition: pg_dump.h:171
char * initproacl
Definition: pg_dump.h:204
char * initdefaclacl
Definition: pg_dump.h:561
bool * attislocal
Definition: pg_dump.h:314
TypeInfo * baseType
Definition: pg_dump.h:191
DumpableObject dobj
Definition: pg_dump.h:250
char * rolname
Definition: pg_dump.h:169
ExtensionInfo * findExtensionByOid(Oid oid)
Definition: common.c:895
char * amname
Definition: pg_dump.h:326
IndxInfo * parentIdx
Definition: pg_dump.h:381
DumpableObject dobj
Definition: pg_dump.h:423
CollInfo * findCollationByOid(Oid oid)
Definition: common.c:873
char * amhandler
Definition: pg_dump.h:227
Oid inhparent
Definition: pg_dump.h:492
char * rolname
Definition: pg_dump.h:197
struct _tableInfo TableInfo
DumpableObject dobj
Definition: pg_dump.h:394
char ** attfdwoptions
Definition: pg_dump.h:317
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:321
DumpableObject dobj
Definition: pg_dump.h:583
OprInfo * getOperators(Archive *fout, int *numOperators)
Definition: pg_dump.c:5146
char * tgargs
Definition: pg_dump.h:410
char evtenabled
Definition: pg_dump.h:429
static int numCollations
Definition: common.c:59
DumpableObject dobj
Definition: pg_dump.h:497
char * proacl
Definition: pg_dump.h:202
char * rproacl
Definition: pg_dump.h:203
char * blobacl
Definition: pg_dump.h:569
struct _extensionInfo ExtensionInfo
int indnkeyattrs
Definition: pg_dump.h:365
Oid tgconstrrelid
Definition: pg_dump.h:413
char * initrfdwacl
Definition: pg_dump.h:537
bool polpermissive
Definition: pg_dump.h:587
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:782
FuncInfo * findFuncByOid(Oid oid)
Definition: common.c:851
char * polname
Definition: pg_dump.h:585
Oid prslextype
Definition: pg_dump.h:502
char * indstatvals
Definition: pg_dump.h:364
char * initrelacl
Definition: pg_dump.h:263
DumpableObject dobj
Definition: pg_dump.h:405
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:6940
struct _constraintInfo * checkexprs
Definition: pg_dump.h:322
int indnattrs
Definition: pg_dump.h:366
char * initrnspacl
Definition: pg_dump.h:148
bool isDefined
Definition: pg_dump.h:179
struct _indxInfo * indexes
Definition: pg_dump.h:334
CatalogId catId
Definition: pg_dump.h:128
char * initrdefaclacl
Definition: pg_dump.h:562
char * checkoption
Definition: pg_dump.h:271
ExtensionInfo * findOwningExtension(CatalogId catalogId)
Definition: common.c:934
TableInfo * getTables(Archive *fout, int *numTables)
Definition: pg_dump.c:6044
DumpableObject dobj
Definition: pg_dump.h:542
CollInfo * getCollations(Archive *fout, int *numCollations)
Definition: pg_dump.c:5229
DumpableObject dobj
Definition: pg_dump.h:358
char * indstatcols
Definition: pg_dump.h:363
bool interesting
Definition: pg_dump.h:293
CatalogId catId
Definition: pg_dump.h:638
char ev_enabled
Definition: pg_dump.h:398
struct _castInfo CastInfo
struct _typeInfo TypeInfo
struct _policyInfo PolicyInfo
char castmethod
Definition: pg_dump.h:476
struct _dictInfo TSDictInfo
char * rolname
Definition: pg_dump.h:239
uint32 minmxid
Definition: pg_dump.h:280
NamespaceInfo * getNamespaces(Archive *fout, int *numNamespaces)
Definition: pg_dump.c:4666
bool indisclustered
Definition: pg_dump.h:369
AggInfo * getAggregates(Archive *fout, int *numAggregates)
Definition: pg_dump.c:5615
DumpableObject dobj
Definition: pg_dump.h:481
char * initsrvacl
Definition: pg_dump.h:549
struct _triggerInfo * triggers
Definition: pg_dump.h:337
char * polroles
Definition: pg_dump.h:588
char * nspacl
Definition: pg_dump.h:145
int numParents
Definition: pg_dump.h:331
DumpableObject dobj
Definition: pg_dump.h:143
char * typstorage
Definition: pg_dump.h:308
char defaclobjtype
Definition: pg_dump.h:558
Oid prsheadline
Definition: pg_dump.h:501
char * rblobacl
Definition: pg_dump.h:570
char * initrblobacl
Definition: pg_dump.h:572
DumpableObject dobj
Definition: pg_dump.h:507
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6877
char * attgenerated
Definition: pg_dump.h:311
char * tgfname
Definition: pg_dump.h:407
bool relispopulated
Definition: pg_dump.h:267
DumpableObjectType objType
Definition: pg_dump.h:127
char * reloftype
Definition: pg_dump.h:285
bool relocatable
Definition: pg_dump.h:154
bool dummy_view
Definition: pg_dump.h:294
DumpableObject dobj
Definition: pg_dump.h:614
RuleInfo * getRules(Archive *fout, int *numRules)
Definition: pg_dump.c:7645
char castcontext
Definition: pg_dump.h:475
Oid oprcode
Definition: pg_dump.h:220
char * adef_expr
Definition: pg_dump.h:345
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:4194
OpfamilyInfo * getOpfamilies(Archive *fout, int *numOpfamilies)
Definition: pg_dump.c:5531
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6989
char * defaclrole
Definition: pg_dump.h:557
char * extversion
Definition: pg_dump.h:156
DumpId getMaxDumpId(void)
Definition: common.c:599