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