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