PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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 #define oideq(x,y) ( (x) == (y) )
22 #define oidle(x,y) ( (x) <= (y) )
23 #define oidge(x,y) ( (x) >= (y) )
24 #define oidzero(x) ( (x) == 0 )
25 
26 /*
27  * The data structures used to store system catalog information. Every
28  * dumpable object is a subclass of DumpableObject.
29  *
30  * NOTE: the structures described here live for the entire pg_dump run;
31  * and in most cases we make a struct for every object we can find in the
32  * catalogs, not only those we are actually going to dump. Hence, it's
33  * best to store a minimal amount of per-object info in these structs,
34  * and retrieve additional per-object info when and if we dump a specific
35  * object. In particular, try to avoid retrieving expensive-to-compute
36  * information until it's known to be needed. We do, however, have to
37  * store enough info to determine whether an object should be dumped and
38  * what order to dump in.
39  */
40 
41 typedef enum
42 {
43  /* When modifying this enum, update priority tables in pg_dump_sort.c! */
63  DO_FK_CONSTRAINT, /* see note for ConstraintInfo */
88 
89 /* component types of an object which can be selected for dumping */
90 typedef uint32 DumpComponents; /* a bitmask of dump object components */
91 #define DUMP_COMPONENT_NONE (0)
92 #define DUMP_COMPONENT_DEFINITION (1 << 0)
93 #define DUMP_COMPONENT_DATA (1 << 1)
94 #define DUMP_COMPONENT_COMMENT (1 << 2)
95 #define DUMP_COMPONENT_SECLABEL (1 << 3)
96 #define DUMP_COMPONENT_ACL (1 << 4)
97 #define DUMP_COMPONENT_POLICY (1 << 5)
98 #define DUMP_COMPONENT_USERMAP (1 << 6)
99 #define DUMP_COMPONENT_ALL (0xFFFF)
100 
101 /*
102  * component types which require us to obtain a lock on the table
103  *
104  * Note that some components only require looking at the information
105  * in the pg_catalog tables and, for those components, we do not need
106  * to lock the table. Be careful here though- some components use
107  * server-side functions which pull the latest information from
108  * SysCache and in those cases we *do* need to lock the table.
109  *
110  * We do not need locks for the COMMENT and SECLABEL components as
111  * those simply query their associated tables without using any
112  * server-side functions. We do not need locks for the ACL component
113  * as we pull that information from pg_class without using any
114  * server-side functions that use SysCache. The USERMAP component
115  * is only relevant for FOREIGN SERVERs and not tables, so no sense
116  * locking a table for that either (that can happen if we are going
117  * to dump "ALL" components for a table).
118  *
119  * We DO need locks for DEFINITION, due to various server-side
120  * functions that are used and POLICY due to pg_get_expr(). We set
121  * this up to grab the lock except in the cases we know to be safe.
122  */
123 #define DUMP_COMPONENTS_REQUIRING_LOCK (\
124  DUMP_COMPONENT_DEFINITION |\
125  DUMP_COMPONENT_DATA |\
126  DUMP_COMPONENT_POLICY)
127 
128 typedef struct _dumpableObject
129 {
131  CatalogId catId; /* zero if not a cataloged object */
132  DumpId dumpId; /* assigned by AssignDumpId() */
133  char *name; /* object name (should never be NULL) */
134  struct _namespaceInfo *namespace; /* containing namespace, or NULL */
135  DumpComponents dump; /* bitmask of components to dump */
136  DumpComponents dump_contains; /* as above, but for contained objects */
137  bool ext_member; /* true if object is member of extension */
138  DumpId *dependencies; /* dumpIds of objects this one depends on */
139  int nDeps; /* number of valid dependencies */
140  int allocDeps; /* allocated size of dependencies[] */
142 
143 typedef struct _namespaceInfo
144 {
146  char *rolname; /* name of owner, or empty string */
147  char *nspacl;
148  char *rnspacl;
149  char *initnspacl;
150  char *initrnspacl;
151 } NamespaceInfo;
152 
153 typedef struct _extensionInfo
154 {
156  char *namespace; /* schema containing extension's objects */
157  bool relocatable;
158  char *extversion;
159  char *extconfig; /* info about configuration tables */
161 } ExtensionInfo;
162 
163 typedef struct _typeInfo
164 {
166 
167  /*
168  * Note: dobj.name is the pg_type.typname entry. format_type() might
169  * produce something different than typname
170  */
171  char *rolname; /* name of owner, or empty string */
172  char *typacl;
173  char *rtypacl;
174  char *inittypacl;
175  char *initrtypacl;
178  char typrelkind; /* 'r', 'v', 'c', etc */
179  char typtype; /* 'b', 'c', etc */
180  bool isArray; /* true if auto-generated array 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  /* these two are set only if table is a sequence owned by a column: */
289  Oid owning_tab; /* OID of table owning sequence */
290  int owning_col; /* attr # of column owning sequence */
292  int relpages; /* table's size in pages (from pg_class) */
293 
294  bool interesting; /* true if need to collect more data */
295  bool dummy_view; /* view's real definition must be postponed */
296  bool postponed_def; /* matview must be postponed into post-data */
297  bool ispartition; /* is table a partition? */
298 
299  /*
300  * These fields are computed only if we decide the table is interesting
301  * (it's either a table to dump, or a direct parent of a dumpable table).
302  */
303  int numatts; /* number of attributes */
304  char **attnames; /* the attribute names */
305  char **atttypnames; /* attribute type names */
306  int *atttypmod; /* type-specific type modifiers */
307  int *attstattarget; /* attribute statistics targets */
308  char *attstorage; /* attribute storage scheme */
309  char *typstorage; /* type storage scheme */
310  bool *attisdropped; /* true if attr is dropped; don't dump it */
311  char *attidentity;
312  int *attlen; /* attribute length, used by binary_upgrade */
313  char *attalign; /* attribute align, used by binary_upgrade */
314  bool *attislocal; /* true if attr has local definition */
315  char **attoptions; /* per-attribute options */
316  Oid *attcollation; /* per-attribute collation selection */
317  char **attfdwoptions; /* per-attribute fdw options */
318  bool *notnull; /* NOT NULL constraints on attributes */
319  bool *inhNotNull; /* true if NOT NULL is inherited */
320  struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
321  struct _constraintInfo *checkexprs; /* CHECK constraints */
322  char *partkeydef; /* partition key definition */
323  char *partbound; /* partition bound definition */
324  bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
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  struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
332  int numTriggers; /* number of triggers for table */
333  struct _triggerInfo *triggers; /* array of TriggerInfo structs */
334 } TableInfo;
335 
336 typedef struct _attrDefInfo
337 {
338  DumpableObject dobj; /* note: dobj.name is name of table */
339  TableInfo *adtable; /* link to table of attribute */
340  int adnum;
341  char *adef_expr; /* decompiled DEFAULT expression */
342  bool separate; /* TRUE if must dump as separate item */
343 } AttrDefInfo;
344 
345 typedef struct _tableDataInfo
346 {
348  TableInfo *tdtable; /* link to table to dump */
349  bool oids; /* include OIDs in data? */
350  char *filtercond; /* WHERE condition to limit rows dumped */
351 } TableDataInfo;
352 
353 typedef struct _indxInfo
354 {
356  TableInfo *indextable; /* link to table the index is for */
357  char *indexdef;
358  char *tablespace; /* tablespace in which index is stored */
359  char *indreloptions; /* options specified by WITH (...) */
360  int indnkeys;
364  /* if there is an associated constraint object, its dumpId: */
366  int relpages; /* relpages of the underlying table */
367 } IndxInfo;
368 
369 typedef struct _statsExtInfo
370 {
372  TableInfo *statsexttable; /* link to table the stats ext is for */
373  char *statsextdef;
374 } StatsExtInfo;
375 
376 typedef struct _ruleInfo
377 {
379  TableInfo *ruletable; /* link to table the rule is for */
380  char ev_type;
383  bool separate; /* TRUE if must dump as separate item */
384  /* separate is always true for non-ON SELECT rules */
385 } RuleInfo;
386 
387 typedef struct _triggerInfo
388 {
390  TableInfo *tgtable; /* link to table the trigger is for */
391  char *tgfname;
392  int tgtype;
393  int tgnargs;
394  char *tgargs;
399  char tgenabled;
402  char *tgdef;
403 } TriggerInfo;
404 
405 typedef struct _evttriggerInfo
406 {
408  char *evtname;
409  char *evtevent;
410  char *evtowner;
411  char *evttags;
412  char *evtfname;
415 
416 /*
417  * struct ConstraintInfo is used for all constraint types. However we
418  * use a different objType for foreign key constraints, to make it easier
419  * to sort them the way we want.
420  *
421  * Note: condeferrable and condeferred are currently only valid for
422  * unique/primary-key constraints. Otherwise that info is in condef.
423  */
424 typedef struct _constraintInfo
425 {
427  TableInfo *contable; /* NULL if domain constraint */
428  TypeInfo *condomain; /* NULL if table constraint */
429  char contype;
430  char *condef; /* definition, if CHECK or FOREIGN KEY */
431  Oid confrelid; /* referenced table, if FOREIGN KEY */
432  DumpId conindex; /* identifies associated index if any */
433  bool condeferrable; /* TRUE if constraint is DEFERRABLE */
434  bool condeferred; /* TRUE if constraint is INITIALLY DEFERRED */
435  bool conislocal; /* TRUE if constraint has local definition */
436  bool separate; /* TRUE if must dump as separate item */
438 
439 typedef struct _procLangInfo
440 {
446  char *lanacl;
447  char *rlanacl;
448  char *initlanacl;
449  char *initrlanacl;
450  char *lanowner; /* name of owner, or empty string */
451 } ProcLangInfo;
452 
453 typedef struct _castInfo
454 {
461 } CastInfo;
462 
463 typedef struct _transformInfo
464 {
470 } TransformInfo;
471 
472 /* InhInfo isn't a DumpableObject, just temporary state */
473 typedef struct _inhInfo
474 {
475  Oid inhrelid; /* OID of a child table */
476  Oid inhparent; /* OID of its parent */
477 } InhInfo;
478 
479 typedef struct _prsInfo
480 {
487 } TSParserInfo;
488 
489 typedef struct _dictInfo
490 {
492  char *rolname;
495 } TSDictInfo;
496 
497 typedef struct _tmplInfo
498 {
503 
504 typedef struct _cfgInfo
505 {
507  char *rolname;
509 } TSConfigInfo;
510 
511 typedef struct _fdwInfo
512 {
514  char *rolname;
515  char *fdwhandler;
517  char *fdwoptions;
518  char *fdwacl;
519  char *rfdwacl;
520  char *initfdwacl;
521  char *initrfdwacl;
522 } FdwInfo;
523 
524 typedef struct _foreignServerInfo
525 {
527  char *rolname;
529  char *srvtype;
530  char *srvversion;
531  char *srvacl;
532  char *rsrvacl;
533  char *initsrvacl;
534  char *initrsrvacl;
535  char *srvoptions;
537 
538 typedef struct _defaultACLInfo
539 {
541  char *defaclrole;
543  char *defaclacl;
544  char *rdefaclacl;
548 
549 typedef struct _blobInfo
550 {
552  char *rolname;
553  char *blobacl;
554  char *rblobacl;
555  char *initblobacl;
557 } BlobInfo;
558 
559 /*
560  * The PolicyInfo struct is used to represent policies on a table and
561  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
562  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
563  * it's non-NULL then this is a regular policy definition.
564  */
565 typedef struct _policyInfo
566 {
569  char *polname; /* null indicates RLS is enabled on rel */
570  char polcmd;
572  char *polroles;
573  char *polqual;
575 } PolicyInfo;
576 
577 /*
578  * The PublicationInfo struct is used to represent publications.
579  */
580 typedef struct _PublicationInfo
581 {
583  char *rolname;
585  bool pubinsert;
586  bool pubupdate;
587  bool pubdelete;
589 
590 /*
591  * The PublicationRelInfo struct is used to represent publication table
592  * mapping.
593  */
594 typedef struct _PublicationRelInfo
595 {
598  char *pubname;
600 
601 /*
602  * The SubscriptionInfo struct is used to represent subscription.
603  */
604 typedef struct _SubscriptionInfo
605 {
607  char *rolname;
608  char *subconninfo;
609  char *subslotname;
613 
614 /*
615  * We build an array of these with an entry for each object that is an
616  * extension member according to pg_depend.
617  */
618 typedef struct _extensionMemberId
619 {
620  CatalogId catId; /* tableoid+oid of some member object */
621  ExtensionInfo *ext; /* owning extension */
623 
624 /* global decls */
625 extern bool force_quotes; /* double-quotes for identifiers flag */
626 extern bool g_verbose; /* verbose flag */
627 
628 /* placeholders for comment starting and ending delimiters */
629 extern char g_comment_start[10];
630 extern char g_comment_end[10];
631 
632 extern char g_opaque_type[10]; /* name for the opaque type */
633 
634 /*
635  * common utility functions
636  */
637 
638 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
639 
640 extern void AssignDumpId(DumpableObject *dobj);
641 extern DumpId createDumpId(void);
642 extern DumpId getMaxDumpId(void);
645 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
646 
647 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
648 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
649 
650 extern TableInfo *findTableByOid(Oid oid);
651 extern TypeInfo *findTypeByOid(Oid oid);
652 extern FuncInfo *findFuncByOid(Oid oid);
653 extern OprInfo *findOprByOid(Oid oid);
654 extern CollInfo *findCollationByOid(Oid oid);
657 
658 extern void setExtensionMembership(ExtensionMemberId *extmems, int nextmems);
659 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
660 
661 extern void parseOidArray(const char *str, Oid *array, int arraysize);
662 
663 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
664  DumpId preBoundaryId, DumpId postBoundaryId);
665 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
666 extern void sortDataAndIndexObjectsBySize(DumpableObject **objs, int numObjs);
667 
668 /*
669  * version specific routines
670  */
671 extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
672 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
673 extern TypeInfo *getTypes(Archive *fout, int *numTypes);
674 extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
675 extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
676 extern OprInfo *getOperators(Archive *fout, int *numOperators);
677 extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
678 extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
679 extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
680 extern CollInfo *getCollations(Archive *fout, int *numCollations);
681 extern ConvInfo *getConversions(Archive *fout, int *numConversions);
682 extern TableInfo *getTables(Archive *fout, int *numTables);
683 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
684 extern InhInfo *getInherits(Archive *fout, int *numInherits);
685 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
686 extern void getExtendedStatistics(Archive *fout, TableInfo tblinfo[], int numTables);
687 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
688 extern RuleInfo *getRules(Archive *fout, int *numRules);
689 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
690 extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
691 extern CastInfo *getCasts(Archive *fout, int *numCasts);
692 extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
693 extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
694 extern bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno);
695 extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
696 extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
697 extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
698 extern TSConfigInfo *getTSConfigurations(Archive *fout, int *numTSConfigs);
700  int *numForeignDataWrappers);
702  int *numForeignServers);
703 extern DefaultACLInfo *getDefaultACLs(Archive *fout, int *numDefaultACLs);
704 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
705  int numExtensions);
706 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
707  int numExtensions);
708 extern EventTriggerInfo *getEventTriggers(Archive *fout, int *numEventTriggers);
709 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
710 extern void getPublications(Archive *fout);
711 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
712  int numTables);
713 extern void getSubscriptions(Archive *fout);
714 
715 #endif /* PG_DUMP_H */
Oid * argtypes
Definition: pg_dump.h:202
DumpableObject dobj
Definition: pg_dump.h:606
TSConfigInfo * getTSConfigurations(Archive *fout, int *numTSConfigs)
Definition: pg_dump.c:8581
char * tgdef
Definition: pg_dump.h:402
char * srvoptions
Definition: pg_dump.h:535
static int numTypes
Definition: common.c:58
char * tablespace
Definition: pg_dump.h:358
char * name
Definition: pg_dump.h:133
struct _PublicationInfo PublicationInfo
ExtensionInfo * ext
Definition: pg_dump.h:621
DumpableObject dobj
Definition: pg_dump.h:240
int DumpId
Definition: pg_backup.h:230
void getPublications(Archive *fout)
Definition: pg_dump.c:3451
struct _tableInfo ** parents
Definition: pg_dump.h:330
DumpableObject dobj
Definition: pg_dump.h:219
char * evtevent
Definition: pg_dump.h:409
ForeignServerInfo * getForeignServers(Archive *fout, int *numForeignServers)
Definition: pg_dump.c:8830
DumpableObject dobj
Definition: pg_dump.h:155
struct _accessMethodInfo AccessMethodInfo
int * atttypmod
Definition: pg_dump.h:306
Oid castsource
Definition: pg_dump.h:456
DumpableObject dobj
Definition: pg_dump.h:191
Oid tmplinit
Definition: pg_dump.h:500
char * reltablespace
Definition: pg_dump.h:271
char * reloptions
Definition: pg_dump.h:272
char relkind
Definition: pg_dump.h:267
char g_opaque_type[10]
Definition: pg_dump.c:126
char * rfdwacl
Definition: pg_dump.h:519
DumpComponents dump
Definition: pg_dump.h:134
char * fdwhandler
Definition: pg_dump.h:515
char * statsextdef
Definition: pg_dump.h:373
struct _constraintInfo * domChecks
Definition: pg_dump.h:186
DumpId * dependencies
Definition: pg_dump.h:138
TSParserInfo * getTSParsers(Archive *fout, int *numTSParsers)
Definition: pg_dump.c:8321
DumpableObject dobj
Definition: pg_dump.h:582
TableInfo * tdtable
Definition: pg_dump.h:348
int relpages
Definition: pg_dump.h:366
struct _inhInfo InhInfo
char * polwithcheck
Definition: pg_dump.h:574
bool isArray
Definition: pg_dump.h:180
ConvInfo * getConversions(Archive *fout, int *numConversions)
Definition: pg_dump.c:4823
char * initlanacl
Definition: pg_dump.h:448
char * inittypacl
Definition: pg_dump.h:174
int nargs
Definition: pg_dump.h:201
struct _namespaceInfo NamespaceInfo
char * partkeydef
Definition: pg_dump.h:322
Oid toast_oid
Definition: pg_dump.h:283
Oid typrelid
Definition: pg_dump.h:177
char * initrlanacl
Definition: pg_dump.h:449
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17296
char * subsynccommit
Definition: pg_dump.h:610
Oid tmpllexize
Definition: pg_dump.h:501
static int numFuncs
Definition: common.c:59
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6842
bool separate
Definition: pg_dump.h:383
TSTemplateInfo * getTSTemplates(Archive *fout, int *numTSTemplates)
Definition: pg_dump.c:8502
char * initrtypacl
Definition: pg_dump.h:175
void parseOidArray(const char *str, Oid *array, int arraysize)
Definition: common.c:967
DumpableObject dobj
Definition: pg_dump.h:371
char * rdefaclacl
Definition: pg_dump.h:544
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:8415
bool hastriggers
Definition: pg_dump.h:277
TypeInfo * getTypes(Archive *fout, int *numTypes)
Definition: pg_dump.c:4401
char * partbound
Definition: pg_dump.h:323
char * initrproacl
Definition: pg_dump.h:207
Oid lang
Definition: pg_dump.h:200
char typrelkind
Definition: pg_dump.h:178
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3188
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7142
char * attstorage
Definition: pg_dump.h:308
DumpableObject dobj
Definition: pg_dump.h:227
DumpableObject dobj
Definition: pg_dump.h:198
EventTriggerInfo * getEventTriggers(Archive *fout, int *numEventTriggers)
Definition: pg_dump.c:7342
char * rolname
Definition: pg_dump.h:253
bool * inhNotNull
Definition: pg_dump.h:319
bool hasindex
Definition: pg_dump.h:275
char * typacl
Definition: pg_dump.h:172
char ** atttypnames
Definition: pg_dump.h:305
bool forcerowsec
Definition: pg_dump.h:279
bool is_identity_sequence
Definition: pg_dump.h:291
bool tgdeferrable
Definition: pg_dump.h:400
struct _foreignServerInfo ForeignServerInfo
struct _transformInfo TransformInfo
static int numTables
Definition: common.c:57
DumpId dumpId
Definition: pg_dump.h:132
Oid dicttemplate
Definition: pg_dump.h:493
DumpableObject dobj
Definition: pg_dump.h:441
bool hasrules
Definition: pg_dump.h:276
unsigned int Oid
Definition: postgres_ext.h:31
OprInfo * findOprByOid(Oid oid)
Definition: common.c:792
char * fdwoptions
Definition: pg_dump.h:517
DumpId conindex
Definition: pg_dump.h:432
bool lanpltrusted
Definition: pg_dump.h:442
DumpId indexconstraint
Definition: pg_dump.h:365
char ** attnames
Definition: pg_dump.h:304
Oid castfunc
Definition: pg_dump.h:458
uint32 toast_minmxid
Definition: pg_dump.h:285
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3614
char * polqual
Definition: pg_dump.h:573
char * indexdef
Definition: pg_dump.h:357
DumpableObject dobj
Definition: pg_dump.h:261
int owning_col
Definition: pg_dump.h:290
char * attalign
Definition: pg_dump.h:313
bool ext_member
Definition: pg_dump.h:137
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17188
TableInfo * tgtable
Definition: pg_dump.h:390
bool hasoids
Definition: pg_dump.h:280
char * initblobacl
Definition: pg_dump.h:555
Oid cfgparser
Definition: pg_dump.h:508
TableInfo * findTableByOid(Oid oid)
Definition: common.c:759
char * initrsrvacl
Definition: pg_dump.h:534
char * subslotname
Definition: pg_dump.h:609
DumpableObject dobj
Definition: pg_dump.h:499
TableInfo * pubtable
Definition: pg_dump.h:597
struct _attrDefInfo AttrDefInfo
DumpableObjectType
Definition: pg_dump.h:41
char * condef
Definition: pg_dump.h:430
char * rnspacl
Definition: pg_dump.h:148
uint32 DumpComponents
Definition: pg_dump.h:90
DumpableObject dobj
Definition: pg_dump.h:246
char * rolname
Definition: pg_dump.h:507
char * rolname
Definition: pg_dump.h:235
FdwInfo * getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
Definition: pg_dump.c:8661
struct _blobInfo BlobInfo
bool indisreplident
Definition: pg_dump.h:363
FuncInfo aggfn
Definition: pg_dump.h:213
char * rolname
Definition: pg_dump.h:247
TransformInfo * getTransforms(Archive *fout, int *numTransforms)
Definition: pg_dump.c:7733
bool g_verbose
Definition: pg_dump.c:91
struct _cfgInfo TSConfigInfo
Oid * attcollation
Definition: pg_dump.h:316
char relpersistence
Definition: pg_dump.h:268
DumpableObject dobj
Definition: pg_dump.h:513
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition: common.c:558
Oid owning_tab
Definition: pg_dump.h:289
bool rowsec
Definition: pg_dump.h:278
struct _oprInfo OprInfo
void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables)
Definition: pg_dump.c:7833
struct _tmplInfo TSTemplateInfo
AccessMethodInfo * getAccessMethods(Archive *fout, int *numAccessMethods)
Definition: pg_dump.c:4899
int * attlen
Definition: pg_dump.h:312
char * rolname
Definition: pg_dump.h:492
bool separate
Definition: pg_dump.h:342
char * attidentity
Definition: pg_dump.h:311
DumpableObject dobj
Definition: pg_dump.h:426
DumpableObject dobj
Definition: pg_dump.h:551
Definition: pg_dump.h:49
struct _triggerInfo TriggerInfo
char * subconninfo
Definition: pg_dump.h:608
struct _opclassInfo OpclassInfo
DumpableObject dobj
Definition: pg_dump.h:455
Oid casttarget
Definition: pg_dump.h:457
char relreplident
Definition: pg_dump.h:270
struct _convInfo ConvInfo
bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno)
Definition: pg_dump.c:8305
static int numOperators
Definition: common.c:60
FuncInfo * getFuncs(Archive *fout, int *numFuncs)
Definition: pg_dump.c:5333
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:739
struct _PublicationRelInfo PublicationRelInfo
struct _SubscriptionInfo SubscriptionInfo
Oid prsend
Definition: pg_dump.h:484
TableInfo * indextable
Definition: pg_dump.h:356
int relpages
Definition: pg_dump.h:292
OpclassInfo * getOpclasses(Archive *fout, int *numOpclasses)
Definition: pg_dump.c:4976
char * rrelacl
Definition: pg_dump.h:264
char * extconfig
Definition: pg_dump.h:159
char * rolname
Definition: pg_dump.h:146
char * rolname
Definition: pg_dump.h:583
void sortDataAndIndexObjectsBySize(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:145
Oid * indkeys
Definition: pg_dump.h:361
char * rolname
Definition: pg_dump.h:552
struct _ruleInfo RuleInfo
char * filtercond
Definition: pg_dump.h:350
DumpableObject dobj
Definition: pg_dump.h:506
struct _fdwInfo FdwInfo
struct _extensionMemberId ExtensionMemberId
struct _procLangInfo ProcLangInfo
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:814
TypeInfo * findTypeByOid(Oid oid)
Definition: common.c:770
int tgnargs
Definition: pg_dump.h:393
char * fdwvalidator
Definition: pg_dump.h:516
Oid lanplcallfoid
Definition: pg_dump.h:443
char * initnspacl
Definition: pg_dump.h:149
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition: common.c:86
char * evtowner
Definition: pg_dump.h:410
struct _collInfo CollInfo
Oid inhrelid
Definition: pg_dump.h:475
bool * attisdropped
Definition: pg_dump.h:310
static int numExtensions
Definition: common.c:63
bool needs_override
Definition: pg_dump.h:324
unsigned int uint32
Definition: c.h:258
int tgtype
Definition: pg_dump.h:392
DumpableObject dobj
Definition: pg_dump.h:540
Oid trffromsql
Definition: pg_dump.h:468
char * rolname
Definition: pg_dump.h:607
DumpComponents dump_contains
Definition: pg_dump.h:136
DumpableObject * findObjectByDumpId(DumpId dumpId)
Definition: common.c:540
TableInfo * adtable
Definition: pg_dump.h:339
TableInfo * poltable
Definition: pg_dump.h:568
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:690
bool is_instead
Definition: pg_dump.h:381
struct _funcInfo FuncInfo
int numTriggers
Definition: pg_dump.h:332
static int numNamespaces
Definition: common.c:62
char * relacl
Definition: pg_dump.h:263
struct _tableDataInfo TableDataInfo
struct _shellTypeInfo ShellTypeInfo
struct _aggInfo AggInfo
Oid typelem
Definition: pg_dump.h:176
char * fdwacl
Definition: pg_dump.h:518
char ev_type
Definition: pg_dump.h:380
void AssignDumpId(DumpableObject *dobj)
Definition: common.c:476
uint32 frozenxid
Definition: pg_dump.h:281
DumpId createDumpId(void)
Definition: common.c:520
bool condeferrable
Definition: pg_dump.h:433
char * tgconstrrelname
Definition: pg_dump.h:398
char * tgconstrname
Definition: pg_dump.h:396
char * subpublications
Definition: pg_dump.h:611
char * rlanacl
Definition: pg_dump.h:447
char * srvversion
Definition: pg_dump.h:530
bool tginitdeferred
Definition: pg_dump.h:401
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition: pg_dump.c:4314
char * initrrelacl
Definition: pg_dump.h:266
char * rolname
Definition: pg_dump.h:220
int * attstattarget
Definition: pg_dump.h:307
struct _defaultACLInfo DefaultACLInfo
int indnkeys
Definition: pg_dump.h:360
CastInfo * getCasts(Archive *fout, int *numCasts)
Definition: pg_dump.c:7617
void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:207
int numatts
Definition: pg_dump.h:303
char * indreloptions
Definition: pg_dump.h:359
DumpableObject dobj
Definition: pg_dump.h:165
TypeInfo * condomain
Definition: pg_dump.h:428
struct _prsInfo TSParserInfo
bool postponed_def
Definition: pg_dump.h:296
bool conislocal
Definition: pg_dump.h:435
char * dictinitoption
Definition: pg_dump.h:494
struct _evttriggerInfo EventTriggerInfo
Oid lanvalidator
Definition: pg_dump.h:445
char * evtfname
Definition: pg_dump.h:412
char * rolname
Definition: pg_dump.h:514
char tgenabled
Definition: pg_dump.h:399
char * defaclacl
Definition: pg_dump.h:543
Oid laninline
Definition: pg_dump.h:444
struct _tableDataInfo * dataObj
Definition: pg_dump.h:331
char * evttags
Definition: pg_dump.h:411
bool tgisconstraint
Definition: pg_dump.h:395
struct _opfamilyInfo OpfamilyInfo
char * evtname
Definition: pg_dump.h:408
DumpableObject dobj
Definition: pg_dump.h:234
char typtype
Definition: pg_dump.h:179
TableInfo * contable
Definition: pg_dump.h:427
ProcLangInfo * getProcLangs(Archive *fout, int *numProcLangs)
Definition: pg_dump.c:7436
char * lanacl
Definition: pg_dump.h:446
DumpableObject dobj
Definition: pg_dump.h:347
char * lanowner
Definition: pg_dump.h:450
int nDomChecks
Definition: pg_dump.h:185
char polcmd
Definition: pg_dump.h:570
struct _indxInfo IndxInfo
bool * notnull
Definition: pg_dump.h:318
char * toast_reloptions
Definition: pg_dump.h:274
DumpableObject dobj
Definition: pg_dump.h:338
bool puballtables
Definition: pg_dump.h:584
struct _dumpableObject DumpableObject
struct _statsExtInfo StatsExtInfo
Oid prstoken
Definition: pg_dump.h:483
int ncheck
Definition: pg_dump.h:286
Oid prsstart
Definition: pg_dump.h:482
char * initfdwacl
Definition: pg_dump.h:520
char ** attoptions
Definition: pg_dump.h:315
uint32 toast_frozenxid
Definition: pg_dump.h:284
void sortDumpableObjects(DumpableObject **objs, int numObjs, DumpId preBoundaryId, DumpId postBoundaryId)
Definition: pg_dump_sort.c:309
TableInfo * ruletable
Definition: pg_dump.h:379
char oprkind
Definition: pg_dump.h:221
bool condeferred
Definition: pg_dump.h:434
Definition: pg_dump.h:73
bool ispartition
Definition: pg_dump.h:297
char * extcondition
Definition: pg_dump.h:160
struct _constraintInfo ConstraintInfo
Oid prorettype
Definition: pg_dump.h:203
void setExtensionMembership(ExtensionMemberId *extmems, int nextmems)
Definition: common.c:836
DefaultACLInfo * getDefaultACLs(Archive *fout, int *numDefaultACLs)
Definition: pg_dump.c:8983
char * rtypacl
Definition: pg_dump.h:173
char * initproacl
Definition: pg_dump.h:206
char * initdefaclacl
Definition: pg_dump.h:545
bool * attislocal
Definition: pg_dump.h:314
TypeInfo * baseType
Definition: pg_dump.h:193
DumpableObject dobj
Definition: pg_dump.h:252
char * rolname
Definition: pg_dump.h:171
ExtensionInfo * findExtensionByOid(Oid oid)
Definition: common.c:825
DumpableObject dobj
Definition: pg_dump.h:407
CollInfo * findCollationByOid(Oid oid)
Definition: common.c:803
char * amhandler
Definition: pg_dump.h:229
Oid inhparent
Definition: pg_dump.h:476
char * rolname
Definition: pg_dump.h:199
struct _tableInfo TableInfo
DumpableObject dobj
Definition: pg_dump.h:378
char ** attfdwoptions
Definition: pg_dump.h:317
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:320
DumpableObject dobj
Definition: pg_dump.h:567
OprInfo * getOperators(Archive *fout, int *numOperators)
Definition: pg_dump.c:4654
char * tgargs
Definition: pg_dump.h:394
char evtenabled
Definition: pg_dump.h:413
static int numCollations
Definition: common.c:61
DumpableObject dobj
Definition: pg_dump.h:481
char * proacl
Definition: pg_dump.h:204
char * rproacl
Definition: pg_dump.h:205
char * blobacl
Definition: pg_dump.h:553
struct _extensionInfo ExtensionInfo
bool force_quotes
Oid tgconstrrelid
Definition: pg_dump.h:397
char * initrfdwacl
Definition: pg_dump.h:521
bool polpermissive
Definition: pg_dump.h:571
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:712
FuncInfo * findFuncByOid(Oid oid)
Definition: common.c:781
char * polname
Definition: pg_dump.h:569
Oid prslextype
Definition: pg_dump.h:486
char * initrelacl
Definition: pg_dump.h:265
DumpableObject dobj
Definition: pg_dump.h:389
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:6405
struct _constraintInfo * checkexprs
Definition: pg_dump.h:321
char * initrnspacl
Definition: pg_dump.h:150
bool isDefined
Definition: pg_dump.h:181
CatalogId catId
Definition: pg_dump.h:131
char * initrdefaclacl
Definition: pg_dump.h:546
char * checkoption
Definition: pg_dump.h:273
ExtensionInfo * findOwningExtension(CatalogId catalogId)
Definition: common.c:852
TableInfo * getTables(Archive *fout, int *numTables)
Definition: pg_dump.c:5567
TableInfo * statsexttable
Definition: pg_dump.h:372
DumpableObject dobj
Definition: pg_dump.h:526
CollInfo * getCollations(Archive *fout, int *numCollations)
Definition: pg_dump.c:4740
DumpableObject dobj
Definition: pg_dump.h:355
bool interesting
Definition: pg_dump.h:294
CatalogId catId
Definition: pg_dump.h:620
char ev_enabled
Definition: pg_dump.h:382
struct _castInfo CastInfo
struct _typeInfo TypeInfo
struct _policyInfo PolicyInfo
char castmethod
Definition: pg_dump.h:460
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:4142
bool indisclustered
Definition: pg_dump.h:362
AggInfo * getAggregates(Archive *fout, int *numAggregates)
Definition: pg_dump.c:5141
DumpableObject dobj
Definition: pg_dump.h:465
char * initsrvacl
Definition: pg_dump.h:533
struct _triggerInfo * triggers
Definition: pg_dump.h:333
char * polroles
Definition: pg_dump.h:572
char * nspacl
Definition: pg_dump.h:147
int numParents
Definition: pg_dump.h:329
DumpableObject dobj
Definition: pg_dump.h:145
char * typstorage
Definition: pg_dump.h:309
char defaclobjtype
Definition: pg_dump.h:542
Oid prsheadline
Definition: pg_dump.h:485
char * rblobacl
Definition: pg_dump.h:554
char * initrblobacl
Definition: pg_dump.h:556
DumpableObject dobj
Definition: pg_dump.h:491
void getExtendedStatistics(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6743
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6354
char * tgfname
Definition: pg_dump.h:391
bool relispopulated
Definition: pg_dump.h:269
DumpableObjectType objType
Definition: pg_dump.h:130
char * reloftype
Definition: pg_dump.h:287
bool relocatable
Definition: pg_dump.h:156
bool dummy_view
Definition: pg_dump.h:295
DumpableObject dobj
Definition: pg_dump.h:596
char g_comment_start[10]
Definition: pg_dump.c:129
RuleInfo * getRules(Archive *fout, int *numRules)
Definition: pg_dump.c:7026
char g_comment_end[10]
Definition: pg_dump.c:130
char castcontext
Definition: pg_dump.h:459
Oid oprcode
Definition: pg_dump.h:222
char * adef_expr
Definition: pg_dump.h:341
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:3763
OpfamilyInfo * getOpfamilies(Archive *fout, int *numOpfamilies)
Definition: pg_dump.c:5054
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6459
char * defaclrole
Definition: pg_dump.h:541
char * extversion
Definition: pg_dump.h:158
DumpId getMaxDumpId(void)
Definition: common.c:529