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 */
291  int relpages; /* table's size in pages (from pg_class) */
292 
293  bool interesting; /* true if need to collect more data */
294  bool dummy_view; /* view's real definition must be postponed */
295  bool postponed_def; /* matview must be postponed into post-data */
296 
297  /*
298  * These fields are computed only if we decide the table is interesting
299  * (it's either a table to dump, or a direct parent of a dumpable table).
300  */
301  int numatts; /* number of attributes */
302  char **attnames; /* the attribute names */
303  char **atttypnames; /* attribute type names */
304  int *atttypmod; /* type-specific type modifiers */
305  int *attstattarget; /* attribute statistics targets */
306  char *attstorage; /* attribute storage scheme */
307  char *typstorage; /* type storage scheme */
308  bool *attisdropped; /* true if attr is dropped; don't dump it */
309  int *attlen; /* attribute length, used by binary_upgrade */
310  char *attalign; /* attribute align, used by binary_upgrade */
311  bool *attislocal; /* true if attr has local definition */
312  char **attoptions; /* per-attribute options */
313  Oid *attcollation; /* per-attribute collation selection */
314  char **attfdwoptions; /* per-attribute fdw options */
315  bool *notnull; /* NOT NULL constraints on attributes */
316  bool *inhNotNull; /* true if NOT NULL is inherited */
317  struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
318  struct _constraintInfo *checkexprs; /* CHECK constraints */
319  char *partkeydef; /* partition key definition */
320 
321  /*
322  * Stuff computed only for dumpable tables.
323  */
324  int numParents; /* number of (immediate) parent tables */
325  struct _tableInfo **parents; /* TableInfos of immediate parents */
326  struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
327  int numTriggers; /* number of triggers for table */
328  struct _triggerInfo *triggers; /* array of TriggerInfo structs */
329  struct _tableInfo *partitionOf; /* TableInfo for the partition parent */
330  char *partitiondef; /* partition key definition */
331 } TableInfo;
332 
333 typedef struct _attrDefInfo
334 {
335  DumpableObject dobj; /* note: dobj.name is name of table */
336  TableInfo *adtable; /* link to table of attribute */
337  int adnum;
338  char *adef_expr; /* decompiled DEFAULT expression */
339  bool separate; /* TRUE if must dump as separate item */
340 } AttrDefInfo;
341 
342 typedef struct _tableDataInfo
343 {
345  TableInfo *tdtable; /* link to table to dump */
346  bool oids; /* include OIDs in data? */
347  char *filtercond; /* WHERE condition to limit rows dumped */
348 } TableDataInfo;
349 
350 typedef struct _indxInfo
351 {
353  TableInfo *indextable; /* link to table the index is for */
354  char *indexdef;
355  char *tablespace; /* tablespace in which index is stored */
356  char *indreloptions; /* options specified by WITH (...) */
357  int indnkeys;
361  /* if there is an associated constraint object, its dumpId: */
363  int relpages; /* relpages of the underlying table */
364 } IndxInfo;
365 
366 typedef struct _statsExtInfo
367 {
369  TableInfo *statsexttable; /* link to table the stats ext is for */
370  char *statsextdef;
371 } StatsExtInfo;
372 
373 typedef struct _ruleInfo
374 {
376  TableInfo *ruletable; /* link to table the rule is for */
377  char ev_type;
380  bool separate; /* TRUE if must dump as separate item */
381  /* separate is always true for non-ON SELECT rules */
382 } RuleInfo;
383 
384 typedef struct _triggerInfo
385 {
387  TableInfo *tgtable; /* link to table the trigger is for */
388  char *tgfname;
389  int tgtype;
390  int tgnargs;
391  char *tgargs;
396  char tgenabled;
399  char *tgdef;
400 } TriggerInfo;
401 
402 typedef struct _evttriggerInfo
403 {
405  char *evtname;
406  char *evtevent;
407  char *evtowner;
408  char *evttags;
409  char *evtfname;
412 
413 /*
414  * struct ConstraintInfo is used for all constraint types. However we
415  * use a different objType for foreign key constraints, to make it easier
416  * to sort them the way we want.
417  *
418  * Note: condeferrable and condeferred are currently only valid for
419  * unique/primary-key constraints. Otherwise that info is in condef.
420  */
421 typedef struct _constraintInfo
422 {
424  TableInfo *contable; /* NULL if domain constraint */
425  TypeInfo *condomain; /* NULL if table constraint */
426  char contype;
427  char *condef; /* definition, if CHECK or FOREIGN KEY */
428  Oid confrelid; /* referenced table, if FOREIGN KEY */
429  DumpId conindex; /* identifies associated index if any */
430  bool condeferrable; /* TRUE if constraint is DEFERRABLE */
431  bool condeferred; /* TRUE if constraint is INITIALLY DEFERRED */
432  bool conislocal; /* TRUE if constraint has local definition */
433  bool separate; /* TRUE if must dump as separate item */
435 
436 typedef struct _procLangInfo
437 {
443  char *lanacl;
444  char *rlanacl;
445  char *initlanacl;
446  char *initrlanacl;
447  char *lanowner; /* name of owner, or empty string */
448 } ProcLangInfo;
449 
450 typedef struct _castInfo
451 {
458 } CastInfo;
459 
460 typedef struct _transformInfo
461 {
467 } TransformInfo;
468 
469 /* InhInfo isn't a DumpableObject, just temporary state */
470 typedef struct _inhInfo
471 {
472  Oid inhrelid; /* OID of a child table */
473  Oid inhparent; /* OID of its parent */
474 } InhInfo;
475 
476 /* PartInfo isn't a DumpableObject, just temporary state */
477 typedef struct _partInfo
478 {
479  Oid partrelid; /* OID of a partition */
480  Oid partparent; /* OID of its parent */
481  char *partdef; /* partition bound definition */
482 } PartInfo;
483 
484 
485 typedef struct _prsInfo
486 {
493 } TSParserInfo;
494 
495 typedef struct _dictInfo
496 {
498  char *rolname;
501 } TSDictInfo;
502 
503 typedef struct _tmplInfo
504 {
509 
510 typedef struct _cfgInfo
511 {
513  char *rolname;
515 } TSConfigInfo;
516 
517 typedef struct _fdwInfo
518 {
520  char *rolname;
521  char *fdwhandler;
523  char *fdwoptions;
524  char *fdwacl;
525  char *rfdwacl;
526  char *initfdwacl;
527  char *initrfdwacl;
528 } FdwInfo;
529 
530 typedef struct _foreignServerInfo
531 {
533  char *rolname;
535  char *srvtype;
536  char *srvversion;
537  char *srvacl;
538  char *rsrvacl;
539  char *initsrvacl;
540  char *initrsrvacl;
541  char *srvoptions;
543 
544 typedef struct _defaultACLInfo
545 {
547  char *defaclrole;
549  char *defaclacl;
550  char *rdefaclacl;
554 
555 typedef struct _blobInfo
556 {
558  char *rolname;
559  char *blobacl;
560  char *rblobacl;
561  char *initblobacl;
563 } BlobInfo;
564 
565 /*
566  * The PolicyInfo struct is used to represent policies on a table and
567  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
568  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
569  * it's non-NULL then this is a regular policy definition.
570  */
571 typedef struct _policyInfo
572 {
575  char *polname; /* null indicates RLS is enabled on rel */
576  char polcmd;
578  char *polroles;
579  char *polqual;
581 } PolicyInfo;
582 
583 /*
584  * The PublicationInfo struct is used to represent publications.
585  */
586 typedef struct _PublicationInfo
587 {
589  char *rolname;
591  bool pubinsert;
592  bool pubupdate;
593  bool pubdelete;
595 
596 /*
597  * The PublicationRelInfo struct is used to represent publication table
598  * mapping.
599  */
600 typedef struct _PublicationRelInfo
601 {
604  char *pubname;
606 
607 /*
608  * The SubscriptionInfo struct is used to represent subscription.
609  */
610 typedef struct _SubscriptionInfo
611 {
613  char *rolname;
615  char *subconninfo;
616  char *subslotname;
619 
620 /*
621  * We build an array of these with an entry for each object that is an
622  * extension member according to pg_depend.
623  */
624 typedef struct _extensionMemberId
625 {
626  CatalogId catId; /* tableoid+oid of some member object */
627  ExtensionInfo *ext; /* owning extension */
629 
630 /* global decls */
631 extern bool force_quotes; /* double-quotes for identifiers flag */
632 extern bool g_verbose; /* verbose flag */
633 
634 /* placeholders for comment starting and ending delimiters */
635 extern char g_comment_start[10];
636 extern char g_comment_end[10];
637 
638 extern char g_opaque_type[10]; /* name for the opaque type */
639 
640 /*
641  * common utility functions
642  */
643 
644 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
645 
646 extern void AssignDumpId(DumpableObject *dobj);
647 extern DumpId createDumpId(void);
648 extern DumpId getMaxDumpId(void);
651 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
652 
653 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
654 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
655 
656 extern TableInfo *findTableByOid(Oid oid);
657 extern TypeInfo *findTypeByOid(Oid oid);
658 extern FuncInfo *findFuncByOid(Oid oid);
659 extern OprInfo *findOprByOid(Oid oid);
660 extern CollInfo *findCollationByOid(Oid oid);
663 
664 extern void setExtensionMembership(ExtensionMemberId *extmems, int nextmems);
665 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
666 
667 extern void parseOidArray(const char *str, Oid *array, int arraysize);
668 
669 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
670  DumpId preBoundaryId, DumpId postBoundaryId);
671 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
672 extern void sortDataAndIndexObjectsBySize(DumpableObject **objs, int numObjs);
673 
674 /*
675  * version specific routines
676  */
677 extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
678 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
679 extern TypeInfo *getTypes(Archive *fout, int *numTypes);
680 extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
681 extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
682 extern OprInfo *getOperators(Archive *fout, int *numOperators);
683 extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
684 extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
685 extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
686 extern CollInfo *getCollations(Archive *fout, int *numCollations);
687 extern ConvInfo *getConversions(Archive *fout, int *numConversions);
688 extern TableInfo *getTables(Archive *fout, int *numTables);
689 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
690 extern InhInfo *getInherits(Archive *fout, int *numInherits);
691 extern PartInfo *getPartitions(Archive *fout, int *numPartitions);
692 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
693 extern void getExtendedStatistics(Archive *fout, TableInfo tblinfo[], int numTables);
694 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
695 extern RuleInfo *getRules(Archive *fout, int *numRules);
696 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
697 extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
698 extern CastInfo *getCasts(Archive *fout, int *numCasts);
699 extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
700 extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
701 extern bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno);
702 extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
703 extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
704 extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
705 extern TSConfigInfo *getTSConfigurations(Archive *fout, int *numTSConfigs);
707  int *numForeignDataWrappers);
709  int *numForeignServers);
710 extern DefaultACLInfo *getDefaultACLs(Archive *fout, int *numDefaultACLs);
711 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
712  int numExtensions);
713 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
714  int numExtensions);
715 extern EventTriggerInfo *getEventTriggers(Archive *fout, int *numEventTriggers);
716 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
717 extern void getTablePartitionKeyInfo(Archive *fout, TableInfo *tblinfo, int numTables);
718 extern void getPublications(Archive *fout);
719 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
720  int numTables);
721 extern void getSubscriptions(Archive *fout);
722 
723 #endif /* PG_DUMP_H */
Oid * argtypes
Definition: pg_dump.h:202
DumpableObject dobj
Definition: pg_dump.h:612
TSConfigInfo * getTSConfigurations(Archive *fout, int *numTSConfigs)
Definition: pg_dump.c:8439
char * tgdef
Definition: pg_dump.h:399
char * srvoptions
Definition: pg_dump.h:541
static int numTypes
Definition: common.c:58
char * tablespace
Definition: pg_dump.h:355
char * name
Definition: pg_dump.h:133
struct _PublicationInfo PublicationInfo
ExtensionInfo * ext
Definition: pg_dump.h:627
DumpableObject dobj
Definition: pg_dump.h:240
int DumpId
Definition: pg_backup.h:229
void getPublications(Archive *fout)
Definition: pg_dump.c:3375
struct _tableInfo ** parents
Definition: pg_dump.h:325
DumpableObject dobj
Definition: pg_dump.h:219
char * evtevent
Definition: pg_dump.h:406
ForeignServerInfo * getForeignServers(Archive *fout, int *numForeignServers)
Definition: pg_dump.c:8688
DumpableObject dobj
Definition: pg_dump.h:155
struct _accessMethodInfo AccessMethodInfo
int * atttypmod
Definition: pg_dump.h:304
Oid castsource
Definition: pg_dump.h:453
DumpableObject dobj
Definition: pg_dump.h:191
Oid tmplinit
Definition: pg_dump.h:506
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:525
DumpComponents dump
Definition: pg_dump.h:134
char * fdwhandler
Definition: pg_dump.h:521
char * statsextdef
Definition: pg_dump.h:370
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:8179
DumpableObject dobj
Definition: pg_dump.h:588
TableInfo * tdtable
Definition: pg_dump.h:345
int relpages
Definition: pg_dump.h:363
struct _inhInfo InhInfo
char * polwithcheck
Definition: pg_dump.h:580
char * partdef
Definition: pg_dump.h:481
bool isArray
Definition: pg_dump.h:180
ConvInfo * getConversions(Archive *fout, int *numConversions)
Definition: pg_dump.c:4669
char * initlanacl
Definition: pg_dump.h:445
char * inittypacl
Definition: pg_dump.h:174
int nargs
Definition: pg_dump.h:201
struct _namespaceInfo NamespaceInfo
char * partkeydef
Definition: pg_dump.h:319
Oid toast_oid
Definition: pg_dump.h:283
Oid typrelid
Definition: pg_dump.h:177
char * initrlanacl
Definition: pg_dump.h:446
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17065
Oid tmpllexize
Definition: pg_dump.h:507
static int numFuncs
Definition: common.c:59
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6689
bool separate
Definition: pg_dump.h:380
TSTemplateInfo * getTSTemplates(Archive *fout, int *numTSTemplates)
Definition: pg_dump.c:8360
char * initrtypacl
Definition: pg_dump.h:175
void parseOidArray(const char *str, Oid *array, int arraysize)
Definition: common.c:1038
DumpableObject dobj
Definition: pg_dump.h:368
char * rdefaclacl
Definition: pg_dump.h:550
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:8273
bool hastriggers
Definition: pg_dump.h:277
TypeInfo * getTypes(Archive *fout, int *numTypes)
Definition: pg_dump.c:4247
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:3112
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6989
char * attstorage
Definition: pg_dump.h:306
DumpableObject dobj
Definition: pg_dump.h:227
DumpableObject dobj
Definition: pg_dump.h:198
EventTriggerInfo * getEventTriggers(Archive *fout, int *numEventTriggers)
Definition: pg_dump.c:7189
char * rolname
Definition: pg_dump.h:253
bool * inhNotNull
Definition: pg_dump.h:316
Oid partrelid
Definition: pg_dump.h:479
bool hasindex
Definition: pg_dump.h:275
char * typacl
Definition: pg_dump.h:172
char ** atttypnames
Definition: pg_dump.h:303
bool forcerowsec
Definition: pg_dump.h:279
bool tgdeferrable
Definition: pg_dump.h:397
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:499
DumpableObject dobj
Definition: pg_dump.h:438
bool hasrules
Definition: pg_dump.h:276
unsigned int Oid
Definition: postgres_ext.h:31
OprInfo * findOprByOid(Oid oid)
Definition: common.c:829
char * fdwoptions
Definition: pg_dump.h:523
DumpId conindex
Definition: pg_dump.h:429
bool lanpltrusted
Definition: pg_dump.h:439
DumpId indexconstraint
Definition: pg_dump.h:362
char ** attnames
Definition: pg_dump.h:302
Oid castfunc
Definition: pg_dump.h:455
uint32 toast_minmxid
Definition: pg_dump.h:285
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3513
char * polqual
Definition: pg_dump.h:579
char * indexdef
Definition: pg_dump.h:354
DumpableObject dobj
Definition: pg_dump.h:261
int owning_col
Definition: pg_dump.h:290
char * attalign
Definition: pg_dump.h:310
bool ext_member
Definition: pg_dump.h:137
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:16957
TableInfo * tgtable
Definition: pg_dump.h:387
bool hasoids
Definition: pg_dump.h:280
char * initblobacl
Definition: pg_dump.h:561
Oid cfgparser
Definition: pg_dump.h:514
TableInfo * findTableByOid(Oid oid)
Definition: common.c:796
char * initrsrvacl
Definition: pg_dump.h:540
char * subslotname
Definition: pg_dump.h:616
DumpableObject dobj
Definition: pg_dump.h:505
TableInfo * pubtable
Definition: pg_dump.h:603
struct _attrDefInfo AttrDefInfo
DumpableObjectType
Definition: pg_dump.h:41
char * condef
Definition: pg_dump.h:427
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:513
char * rolname
Definition: pg_dump.h:235
FdwInfo * getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
Definition: pg_dump.c:8519
struct _blobInfo BlobInfo
Oid partparent
Definition: pg_dump.h:480
bool indisreplident
Definition: pg_dump.h:360
FuncInfo aggfn
Definition: pg_dump.h:213
char * rolname
Definition: pg_dump.h:247
TransformInfo * getTransforms(Archive *fout, int *numTransforms)
Definition: pg_dump.c:7580
bool g_verbose
Definition: pg_dump.c:90
struct _cfgInfo TSConfigInfo
Oid * attcollation
Definition: pg_dump.h:313
char relpersistence
Definition: pg_dump.h:268
DumpableObject dobj
Definition: pg_dump.h:519
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition: common.c:595
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:7723
struct _tmplInfo TSTemplateInfo
AccessMethodInfo * getAccessMethods(Archive *fout, int *numAccessMethods)
Definition: pg_dump.c:4745
int * attlen
Definition: pg_dump.h:309
char * rolname
Definition: pg_dump.h:498
bool separate
Definition: pg_dump.h:339
DumpableObject dobj
Definition: pg_dump.h:423
DumpableObject dobj
Definition: pg_dump.h:557
Definition: pg_dump.h:49
struct _triggerInfo TriggerInfo
char * subconninfo
Definition: pg_dump.h:615
struct _opclassInfo OpclassInfo
DumpableObject dobj
Definition: pg_dump.h:452
Oid casttarget
Definition: pg_dump.h:454
char relreplident
Definition: pg_dump.h:270
struct _convInfo ConvInfo
bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno)
Definition: pg_dump.c:8163
static int numOperators
Definition: common.c:60
FuncInfo * getFuncs(Archive *fout, int *numFuncs)
Definition: pg_dump.c:5179
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:776
struct _PublicationRelInfo PublicationRelInfo
struct _SubscriptionInfo SubscriptionInfo
Oid prsend
Definition: pg_dump.h:490
TableInfo * indextable
Definition: pg_dump.h:353
int relpages
Definition: pg_dump.h:291
OpclassInfo * getOpclasses(Archive *fout, int *numOpclasses)
Definition: pg_dump.c:4822
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:589
void sortDataAndIndexObjectsBySize(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:145
Oid * indkeys
Definition: pg_dump.h:358
char * rolname
Definition: pg_dump.h:558
struct _ruleInfo RuleInfo
char * filtercond
Definition: pg_dump.h:347
DumpableObject dobj
Definition: pg_dump.h:512
struct _fdwInfo FdwInfo
struct _extensionMemberId ExtensionMemberId
struct _procLangInfo ProcLangInfo
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:851
TypeInfo * findTypeByOid(Oid oid)
Definition: common.c:807
int tgnargs
Definition: pg_dump.h:390
char * fdwvalidator
Definition: pg_dump.h:522
Oid lanplcallfoid
Definition: pg_dump.h:440
char * initnspacl
Definition: pg_dump.h:149
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition: common.c:90
char * evtowner
Definition: pg_dump.h:407
struct _collInfo CollInfo
Oid inhrelid
Definition: pg_dump.h:472
bool * attisdropped
Definition: pg_dump.h:308
static int numExtensions
Definition: common.c:63
unsigned int uint32
Definition: c.h:268
int tgtype
Definition: pg_dump.h:389
DumpableObject dobj
Definition: pg_dump.h:546
Oid trffromsql
Definition: pg_dump.h:465
char * rolname
Definition: pg_dump.h:613
DumpComponents dump_contains
Definition: pg_dump.h:136
DumpableObject * findObjectByDumpId(DumpId dumpId)
Definition: common.c:577
TableInfo * adtable
Definition: pg_dump.h:336
TableInfo * poltable
Definition: pg_dump.h:574
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:727
bool is_instead
Definition: pg_dump.h:378
struct _funcInfo FuncInfo
int numTriggers
Definition: pg_dump.h:327
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:524
char ev_type
Definition: pg_dump.h:377
void AssignDumpId(DumpableObject *dobj)
Definition: common.c:513
uint32 frozenxid
Definition: pg_dump.h:281
DumpId createDumpId(void)
Definition: common.c:557
bool condeferrable
Definition: pg_dump.h:430
char * tgconstrrelname
Definition: pg_dump.h:395
char * tgconstrname
Definition: pg_dump.h:393
char * subpublications
Definition: pg_dump.h:617
char * rlanacl
Definition: pg_dump.h:444
char * srvversion
Definition: pg_dump.h:536
bool tginitdeferred
Definition: pg_dump.h:398
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition: pg_dump.c:4160
char * initrrelacl
Definition: pg_dump.h:266
char * rolname
Definition: pg_dump.h:220
int * attstattarget
Definition: pg_dump.h:305
struct _defaultACLInfo DefaultACLInfo
int indnkeys
Definition: pg_dump.h:357
CastInfo * getCasts(Archive *fout, int *numCasts)
Definition: pg_dump.c:7464
void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:207
int numatts
Definition: pg_dump.h:301
char * indreloptions
Definition: pg_dump.h:356
DumpableObject dobj
Definition: pg_dump.h:165
TypeInfo * condomain
Definition: pg_dump.h:425
struct _prsInfo TSParserInfo
bool postponed_def
Definition: pg_dump.h:295
bool conislocal
Definition: pg_dump.h:432
char * dictinitoption
Definition: pg_dump.h:500
struct _evttriggerInfo EventTriggerInfo
Oid lanvalidator
Definition: pg_dump.h:442
char * evtfname
Definition: pg_dump.h:409
char * rolname
Definition: pg_dump.h:520
char tgenabled
Definition: pg_dump.h:396
char * defaclacl
Definition: pg_dump.h:549
Oid laninline
Definition: pg_dump.h:441
struct _tableDataInfo * dataObj
Definition: pg_dump.h:326
char * evttags
Definition: pg_dump.h:408
bool tgisconstraint
Definition: pg_dump.h:392
struct _opfamilyInfo OpfamilyInfo
char * evtname
Definition: pg_dump.h:405
DumpableObject dobj
Definition: pg_dump.h:234
char typtype
Definition: pg_dump.h:179
TableInfo * contable
Definition: pg_dump.h:424
ProcLangInfo * getProcLangs(Archive *fout, int *numProcLangs)
Definition: pg_dump.c:7283
char * lanacl
Definition: pg_dump.h:443
DumpableObject dobj
Definition: pg_dump.h:344
char * lanowner
Definition: pg_dump.h:447
int nDomChecks
Definition: pg_dump.h:185
char polcmd
Definition: pg_dump.h:576
struct _indxInfo IndxInfo
bool * notnull
Definition: pg_dump.h:315
char * toast_reloptions
Definition: pg_dump.h:274
DumpableObject dobj
Definition: pg_dump.h:335
bool puballtables
Definition: pg_dump.h:590
struct _dumpableObject DumpableObject
struct _statsExtInfo StatsExtInfo
Oid prstoken
Definition: pg_dump.h:489
int ncheck
Definition: pg_dump.h:286
Oid prsstart
Definition: pg_dump.h:488
char * initfdwacl
Definition: pg_dump.h:526
char ** attoptions
Definition: pg_dump.h:312
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:376
char * partitiondef
Definition: pg_dump.h:330
char oprkind
Definition: pg_dump.h:221
bool condeferred
Definition: pg_dump.h:431
Definition: pg_dump.h:73
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:873
DefaultACLInfo * getDefaultACLs(Archive *fout, int *numDefaultACLs)
Definition: pg_dump.c:8841
char * rtypacl
Definition: pg_dump.h:173
char * initproacl
Definition: pg_dump.h:206
char * initdefaclacl
Definition: pg_dump.h:551
bool * attislocal
Definition: pg_dump.h:311
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:862
struct _tableInfo * partitionOf
Definition: pg_dump.h:329
DumpableObject dobj
Definition: pg_dump.h:404
CollInfo * findCollationByOid(Oid oid)
Definition: common.c:840
char * amhandler
Definition: pg_dump.h:229
Oid inhparent
Definition: pg_dump.h:473
char * rolname
Definition: pg_dump.h:199
struct _tableInfo TableInfo
DumpableObject dobj
Definition: pg_dump.h:375
char ** attfdwoptions
Definition: pg_dump.h:314
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:317
DumpableObject dobj
Definition: pg_dump.h:573
OprInfo * getOperators(Archive *fout, int *numOperators)
Definition: pg_dump.c:4500
char * tgargs
Definition: pg_dump.h:391
char evtenabled
Definition: pg_dump.h:410
static int numCollations
Definition: common.c:61
DumpableObject dobj
Definition: pg_dump.h:487
char * proacl
Definition: pg_dump.h:204
char * rproacl
Definition: pg_dump.h:205
char * blobacl
Definition: pg_dump.h:559
struct _extensionInfo ExtensionInfo
bool force_quotes
Oid tgconstrrelid
Definition: pg_dump.h:394
char * initrfdwacl
Definition: pg_dump.h:527
bool polpermissive
Definition: pg_dump.h:577
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:749
FuncInfo * findFuncByOid(Oid oid)
Definition: common.c:818
char * polname
Definition: pg_dump.h:575
Oid prslextype
Definition: pg_dump.h:492
char * initrelacl
Definition: pg_dump.h:265
DumpableObject dobj
Definition: pg_dump.h:386
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:6187
struct _constraintInfo * checkexprs
Definition: pg_dump.h:318
char * initrnspacl
Definition: pg_dump.h:150
struct _partInfo PartInfo
bool isDefined
Definition: pg_dump.h:181
CatalogId catId
Definition: pg_dump.h:131
char * initrdefaclacl
Definition: pg_dump.h:552
PartInfo * getPartitions(Archive *fout, int *numPartitions)
Definition: pg_dump.c:6245
char * checkoption
Definition: pg_dump.h:273
ExtensionInfo * findOwningExtension(CatalogId catalogId)
Definition: common.c:889
TableInfo * getTables(Archive *fout, int *numTables)
Definition: pg_dump.c:5413
TableInfo * statsexttable
Definition: pg_dump.h:369
DumpableObject dobj
Definition: pg_dump.h:532
CollInfo * getCollations(Archive *fout, int *numCollations)
Definition: pg_dump.c:4586
DumpableObject dobj
Definition: pg_dump.h:352
bool interesting
Definition: pg_dump.h:293
CatalogId catId
Definition: pg_dump.h:626
char ev_enabled
Definition: pg_dump.h:379
struct _castInfo CastInfo
struct _typeInfo TypeInfo
void getTablePartitionKeyInfo(Archive *fout, TableInfo *tblinfo, int numTables)
Definition: pg_dump.c:7674
struct _policyInfo PolicyInfo
char castmethod
Definition: pg_dump.h:457
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:3993
bool indisclustered
Definition: pg_dump.h:359
AggInfo * getAggregates(Archive *fout, int *numAggregates)
Definition: pg_dump.c:4987
DumpableObject dobj
Definition: pg_dump.h:462
char * initsrvacl
Definition: pg_dump.h:539
struct _triggerInfo * triggers
Definition: pg_dump.h:328
char * polroles
Definition: pg_dump.h:578
char * nspacl
Definition: pg_dump.h:147
int numParents
Definition: pg_dump.h:324
DumpableObject dobj
Definition: pg_dump.h:145
char * typstorage
Definition: pg_dump.h:307
char defaclobjtype
Definition: pg_dump.h:548
Oid prsheadline
Definition: pg_dump.h:491
char * rblobacl
Definition: pg_dump.h:560
char * initrblobacl
Definition: pg_dump.h:562
DumpableObject dobj
Definition: pg_dump.h:497
void getExtendedStatistics(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6595
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6136
char * tgfname
Definition: pg_dump.h:388
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:294
DumpableObject dobj
Definition: pg_dump.h:602
char g_comment_start[10]
Definition: pg_dump.c:129
RuleInfo * getRules(Archive *fout, int *numRules)
Definition: pg_dump.c:6873
char g_comment_end[10]
Definition: pg_dump.c:130
char castcontext
Definition: pg_dump.h:456
Oid oprcode
Definition: pg_dump.h:222
char * adef_expr
Definition: pg_dump.h:338
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:3646
OpfamilyInfo * getOpfamilies(Archive *fout, int *numOpfamilies)
Definition: pg_dump.c:4900
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6311
char * defaclrole
Definition: pg_dump.h:547
char * extversion
Definition: pg_dump.h:158
DumpId getMaxDumpId(void)
Definition: common.c:566