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