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