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 indnkeys;
367  Oid parentidx; /* if partitioned, parent index OID */
368  /* if there is an associated constraint object, its dumpId: */
370  int relpages; /* relpages of the underlying table */
371 } IndxInfo;
372 
373 typedef struct _indexAttachInfo
374 {
376  IndxInfo *parentIdx; /* link to index on partitioned table */
377  IndxInfo *partitionIdx; /* link to index on partition */
379 
380 typedef struct _statsExtInfo
381 {
383  TableInfo *statsexttable; /* link to table the stats ext is for */
384  char *statsextdef;
385 } StatsExtInfo;
386 
387 typedef struct _ruleInfo
388 {
390  TableInfo *ruletable; /* link to table the rule is for */
391  char ev_type;
394  bool separate; /* true if must dump as separate item */
395  /* separate is always true for non-ON SELECT rules */
396 } RuleInfo;
397 
398 typedef struct _triggerInfo
399 {
401  TableInfo *tgtable; /* link to table the trigger is for */
402  char *tgfname;
403  int tgtype;
404  int tgnargs;
405  char *tgargs;
410  char tgenabled;
413  char *tgdef;
414 } TriggerInfo;
415 
416 typedef struct _evttriggerInfo
417 {
419  char *evtname;
420  char *evtevent;
421  char *evtowner;
422  char *evttags;
423  char *evtfname;
426 
427 /*
428  * struct ConstraintInfo is used for all constraint types. However we
429  * use a different objType for foreign key constraints, to make it easier
430  * to sort them the way we want.
431  *
432  * Note: condeferrable and condeferred are currently only valid for
433  * unique/primary-key constraints. Otherwise that info is in condef.
434  */
435 typedef struct _constraintInfo
436 {
438  TableInfo *contable; /* NULL if domain constraint */
439  TypeInfo *condomain; /* NULL if table constraint */
440  char contype;
441  char *condef; /* definition, if CHECK or FOREIGN KEY */
442  Oid confrelid; /* referenced table, if FOREIGN KEY */
443  DumpId conindex; /* identifies associated index if any */
444  bool condeferrable; /* true if constraint is DEFERRABLE */
445  bool condeferred; /* true if constraint is INITIALLY DEFERRED */
446  bool conislocal; /* true if constraint has local definition */
447  bool separate; /* true if must dump as separate item */
449 
450 typedef struct _procLangInfo
451 {
457  char *lanacl;
458  char *rlanacl;
459  char *initlanacl;
460  char *initrlanacl;
461  char *lanowner; /* name of owner, or empty string */
462 } ProcLangInfo;
463 
464 typedef struct _castInfo
465 {
472 } CastInfo;
473 
474 typedef struct _transformInfo
475 {
481 } TransformInfo;
482 
483 /* InhInfo isn't a DumpableObject, just temporary state */
484 typedef struct _inhInfo
485 {
486  Oid inhrelid; /* OID of a child table */
487  Oid inhparent; /* OID of its parent */
488 } InhInfo;
489 
490 typedef struct _prsInfo
491 {
498 } TSParserInfo;
499 
500 typedef struct _dictInfo
501 {
503  char *rolname;
506 } TSDictInfo;
507 
508 typedef struct _tmplInfo
509 {
514 
515 typedef struct _cfgInfo
516 {
518  char *rolname;
520 } TSConfigInfo;
521 
522 typedef struct _fdwInfo
523 {
525  char *rolname;
526  char *fdwhandler;
528  char *fdwoptions;
529  char *fdwacl;
530  char *rfdwacl;
531  char *initfdwacl;
532  char *initrfdwacl;
533 } FdwInfo;
534 
535 typedef struct _foreignServerInfo
536 {
538  char *rolname;
540  char *srvtype;
541  char *srvversion;
542  char *srvacl;
543  char *rsrvacl;
544  char *initsrvacl;
545  char *initrsrvacl;
546  char *srvoptions;
548 
549 typedef struct _defaultACLInfo
550 {
552  char *defaclrole;
554  char *defaclacl;
555  char *rdefaclacl;
559 
560 typedef struct _blobInfo
561 {
563  char *rolname;
564  char *blobacl;
565  char *rblobacl;
566  char *initblobacl;
568 } BlobInfo;
569 
570 /*
571  * The PolicyInfo struct is used to represent policies on a table and
572  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
573  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
574  * it's non-NULL then this is a regular policy definition.
575  */
576 typedef struct _policyInfo
577 {
580  char *polname; /* null indicates RLS is enabled on rel */
581  char polcmd;
583  char *polroles;
584  char *polqual;
586 } PolicyInfo;
587 
588 /*
589  * The PublicationInfo struct is used to represent publications.
590  */
591 typedef struct _PublicationInfo
592 {
594  char *rolname;
596  bool pubinsert;
597  bool pubupdate;
598  bool pubdelete;
600 
601 /*
602  * The PublicationRelInfo struct is used to represent publication table
603  * mapping.
604  */
605 typedef struct _PublicationRelInfo
606 {
609  char *pubname;
611 
612 /*
613  * The SubscriptionInfo struct is used to represent subscription.
614  */
615 typedef struct _SubscriptionInfo
616 {
618  char *rolname;
619  char *subconninfo;
620  char *subslotname;
624 
625 /*
626  * We build an array of these with an entry for each object that is an
627  * extension member according to pg_depend.
628  */
629 typedef struct _extensionMemberId
630 {
631  CatalogId catId; /* tableoid+oid of some member object */
632  ExtensionInfo *ext; /* owning extension */
634 
635 /* global decls */
636 extern bool force_quotes; /* double-quotes for identifiers flag */
637 extern bool g_verbose; /* verbose flag */
638 
639 /* placeholders for comment starting and ending delimiters */
640 extern char g_comment_start[10];
641 extern char g_comment_end[10];
642 
643 extern char g_opaque_type[10]; /* name for the opaque type */
644 
645 /*
646  * common utility functions
647  */
648 
649 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
650 
651 extern void AssignDumpId(DumpableObject *dobj);
652 extern DumpId createDumpId(void);
653 extern DumpId getMaxDumpId(void);
656 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
657 
658 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
659 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
660 
661 extern TableInfo *findTableByOid(Oid oid);
662 extern TypeInfo *findTypeByOid(Oid oid);
663 extern FuncInfo *findFuncByOid(Oid oid);
664 extern OprInfo *findOprByOid(Oid oid);
665 extern CollInfo *findCollationByOid(Oid oid);
668 
669 extern void setExtensionMembership(ExtensionMemberId *extmems, int nextmems);
670 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
671 
672 extern void parseOidArray(const char *str, Oid *array, int arraysize);
673 
674 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
675  DumpId preBoundaryId, DumpId postBoundaryId);
676 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
677 extern void sortDataAndIndexObjectsBySize(DumpableObject **objs, int numObjs);
678 
679 /*
680  * version specific routines
681  */
682 extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
683 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
684 extern TypeInfo *getTypes(Archive *fout, int *numTypes);
685 extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
686 extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
687 extern OprInfo *getOperators(Archive *fout, int *numOperators);
688 extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
689 extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
690 extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
691 extern CollInfo *getCollations(Archive *fout, int *numCollations);
692 extern ConvInfo *getConversions(Archive *fout, int *numConversions);
693 extern TableInfo *getTables(Archive *fout, int *numTables);
694 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
695 extern InhInfo *getInherits(Archive *fout, int *numInherits);
696 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
697 extern void getExtendedStatistics(Archive *fout, TableInfo tblinfo[], int numTables);
698 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
699 extern RuleInfo *getRules(Archive *fout, int *numRules);
700 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
701 extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
702 extern CastInfo *getCasts(Archive *fout, int *numCasts);
703 extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
704 extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
705 extern bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno);
706 extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
707 extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
708 extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
709 extern TSConfigInfo *getTSConfigurations(Archive *fout, int *numTSConfigs);
711  int *numForeignDataWrappers);
713  int *numForeignServers);
714 extern DefaultACLInfo *getDefaultACLs(Archive *fout, int *numDefaultACLs);
715 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
716  int numExtensions);
717 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
718  int numExtensions);
719 extern EventTriggerInfo *getEventTriggers(Archive *fout, int *numEventTriggers);
720 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
721 extern void getPublications(Archive *fout);
722 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
723  int numTables);
724 extern void getSubscriptions(Archive *fout);
725 
726 #endif /* PG_DUMP_H */
Oid * argtypes
Definition: pg_dump.h:203
DumpableObject dobj
Definition: pg_dump.h:617
TSConfigInfo * getTSConfigurations(Archive *fout, int *numTSConfigs)
Definition: pg_dump.c:8669
char * tgdef
Definition: pg_dump.h:413
char * srvoptions
Definition: pg_dump.h:546
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:632
DumpableObject dobj
Definition: pg_dump.h:241
int DumpId
Definition: pg_backup.h:230
void getPublications(Archive *fout)
Definition: pg_dump.c:3455
struct _tableInfo ** parents
Definition: pg_dump.h:331
DumpableObject dobj
Definition: pg_dump.h:220
char * evtevent
Definition: pg_dump.h:420
ForeignServerInfo * getForeignServers(Archive *fout, int *numForeignServers)
Definition: pg_dump.c:8918
DumpableObject dobj
Definition: pg_dump.h:156
struct _accessMethodInfo AccessMethodInfo
int * atttypmod
Definition: pg_dump.h:307
Oid castsource
Definition: pg_dump.h:467
DumpableObject dobj
Definition: pg_dump.h:192
Oid tmplinit
Definition: pg_dump.h:511
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:127
char * rfdwacl
Definition: pg_dump.h:530
DumpComponents dump
Definition: pg_dump.h:135
char * fdwhandler
Definition: pg_dump.h:526
char * statsextdef
Definition: pg_dump.h:384
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:8409
DumpableObject dobj
Definition: pg_dump.h:593
TableInfo * tdtable
Definition: pg_dump.h:351
int relpages
Definition: pg_dump.h:370
struct _inhInfo InhInfo
char * polwithcheck
Definition: pg_dump.h:585
bool isArray
Definition: pg_dump.h:181
ConvInfo * getConversions(Archive *fout, int *numConversions)
Definition: pg_dump.c:4866
char * initlanacl
Definition: pg_dump.h:459
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:460
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17532
char * subsynccommit
Definition: pg_dump.h:621
Oid tmpllexize
Definition: pg_dump.h:512
static int numFuncs
Definition: common.c:59
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6930
bool separate
Definition: pg_dump.h:394
TSTemplateInfo * getTSTemplates(Archive *fout, int *numTSTemplates)
Definition: pg_dump.c:8590
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:382
char * rdefaclacl
Definition: pg_dump.h:555
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:8503
bool hastriggers
Definition: pg_dump.h:278
TypeInfo * getTypes(Archive *fout, int *numTypes)
Definition: pg_dump.c:4444
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:3192
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7230
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:7430
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:411
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:504
DumpableObject dobj
Definition: pg_dump.h:452
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:528
DumpId conindex
Definition: pg_dump.h:443
bool lanpltrusted
Definition: pg_dump.h:453
DumpId indexconstraint
Definition: pg_dump.h:369
char ** attnames
Definition: pg_dump.h:305
Oid castfunc
Definition: pg_dump.h:469
uint32 toast_minmxid
Definition: pg_dump.h:286
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3621
char * polqual
Definition: pg_dump.h:584
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:17424
TableInfo * tgtable
Definition: pg_dump.h:401
bool hasoids
Definition: pg_dump.h:281
char * initblobacl
Definition: pg_dump.h:566
Oid cfgparser
Definition: pg_dump.h:519
TableInfo * findTableByOid(Oid oid)
Definition: common.c:852
char * initrsrvacl
Definition: pg_dump.h:545
char * subslotname
Definition: pg_dump.h:620
Oid parentidx
Definition: pg_dump.h:367
DumpableObject dobj
Definition: pg_dump.h:510
TableInfo * pubtable
Definition: pg_dump.h:608
struct _attrDefInfo AttrDefInfo
DumpableObjectType
Definition: pg_dump.h:41
char * condef
Definition: pg_dump.h:441
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:518
char * rolname
Definition: pg_dump.h:236
FdwInfo * getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
Definition: pg_dump.c:8749
struct _blobInfo BlobInfo
bool indisreplident
Definition: pg_dump.h:366
FuncInfo aggfn
Definition: pg_dump.h:214
char * rolname
Definition: pg_dump.h:248
TransformInfo * getTransforms(Archive *fout, int *numTransforms)
Definition: pg_dump.c:7821
bool g_verbose
Definition: pg_dump.c:92
struct _cfgInfo TSConfigInfo
DumpableObject dobj
Definition: pg_dump.h:375
Oid * attcollation
Definition: pg_dump.h:317
char relpersistence
Definition: pg_dump.h:269
DumpableObject dobj
Definition: pg_dump.h:524
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:7921
struct _tmplInfo TSTemplateInfo
AccessMethodInfo * getAccessMethods(Archive *fout, int *numAccessMethods)
Definition: pg_dump.c:4942
int * attlen
Definition: pg_dump.h:313
char * rolname
Definition: pg_dump.h:503
bool separate
Definition: pg_dump.h:345
char * attidentity
Definition: pg_dump.h:312
DumpableObject dobj
Definition: pg_dump.h:437
DumpableObject dobj
Definition: pg_dump.h:562
Definition: pg_dump.h:49
struct _triggerInfo TriggerInfo
char * subconninfo
Definition: pg_dump.h:619
struct _opclassInfo OpclassInfo
DumpableObject dobj
Definition: pg_dump.h:466
Oid casttarget
Definition: pg_dump.h:468
char relreplident
Definition: pg_dump.h:271
struct _convInfo ConvInfo
bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno)
Definition: pg_dump.c:8393
static int numOperators
Definition: common.c:60
FuncInfo * getFuncs(Archive *fout, int *numFuncs)
Definition: pg_dump.c:5376
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:832
struct _PublicationRelInfo PublicationRelInfo
struct _SubscriptionInfo SubscriptionInfo
Oid prsend
Definition: pg_dump.h:495
TableInfo * indextable
Definition: pg_dump.h:359
int relpages
Definition: pg_dump.h:293
OpclassInfo * getOpclasses(Archive *fout, int *numOpclasses)
Definition: pg_dump.c:5019
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:594
void sortDataAndIndexObjectsBySize(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:150
Oid * indkeys
Definition: pg_dump.h:364
char * rolname
Definition: pg_dump.h:563
struct _ruleInfo RuleInfo
char * filtercond
Definition: pg_dump.h:353
DumpableObject dobj
Definition: pg_dump.h:517
struct _fdwInfo FdwInfo
struct _extensionMemberId ExtensionMemberId
struct _procLangInfo ProcLangInfo
IndxInfo * partitionIdx
Definition: pg_dump.h:377
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:907
TypeInfo * findTypeByOid(Oid oid)
Definition: common.c:863
int tgnargs
Definition: pg_dump.h:404
char * fdwvalidator
Definition: pg_dump.h:527
Oid lanplcallfoid
Definition: pg_dump.h:454
char * initnspacl
Definition: pg_dump.h:150
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition: common.c:89
char * evtowner
Definition: pg_dump.h:421
struct _collInfo CollInfo
Oid inhrelid
Definition: pg_dump.h:486
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:306
int tgtype
Definition: pg_dump.h:403
DumpableObject dobj
Definition: pg_dump.h:551
Oid trffromsql
Definition: pg_dump.h:479
char * rolname
Definition: pg_dump.h:618
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:579
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:783
bool is_instead
Definition: pg_dump.h:392
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:529
char ev_type
Definition: pg_dump.h:391
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:444
char * tgconstrrelname
Definition: pg_dump.h:409
char * tgconstrname
Definition: pg_dump.h:407
char * subpublications
Definition: pg_dump.h:622
char * rlanacl
Definition: pg_dump.h:458
char * srvversion
Definition: pg_dump.h:541
bool tginitdeferred
Definition: pg_dump.h:412
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition: pg_dump.c:4357
char * initrrelacl
Definition: pg_dump.h:267
char * rolname
Definition: pg_dump.h:221
int * attstattarget
Definition: pg_dump.h:308
struct _defaultACLInfo DefaultACLInfo
int indnkeys
Definition: pg_dump.h:363
CastInfo * getCasts(Archive *fout, int *numCasts)
Definition: pg_dump.c:7705
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:439
struct _prsInfo TSParserInfo
bool postponed_def
Definition: pg_dump.h:297
bool conislocal
Definition: pg_dump.h:446
char * dictinitoption
Definition: pg_dump.h:505
struct _evttriggerInfo EventTriggerInfo
Oid lanvalidator
Definition: pg_dump.h:456
char * evtfname
Definition: pg_dump.h:423
char * rolname
Definition: pg_dump.h:525
char tgenabled
Definition: pg_dump.h:410
char * defaclacl
Definition: pg_dump.h:554
Oid laninline
Definition: pg_dump.h:455
struct _tableDataInfo * dataObj
Definition: pg_dump.h:334
char * evttags
Definition: pg_dump.h:422
bool tgisconstraint
Definition: pg_dump.h:406
int numIndexes
Definition: pg_dump.h:332
struct _opfamilyInfo OpfamilyInfo
char * evtname
Definition: pg_dump.h:419
DumpableObject dobj
Definition: pg_dump.h:235
char typtype
Definition: pg_dump.h:180
TableInfo * contable
Definition: pg_dump.h:438
ProcLangInfo * getProcLangs(Archive *fout, int *numProcLangs)
Definition: pg_dump.c:7524
char * lanacl
Definition: pg_dump.h:457
DumpableObject dobj
Definition: pg_dump.h:350
char * lanowner
Definition: pg_dump.h:461
int nDomChecks
Definition: pg_dump.h:186
char polcmd
Definition: pg_dump.h:581
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:595
struct _dumpableObject DumpableObject
struct _statsExtInfo StatsExtInfo
Oid prstoken
Definition: pg_dump.h:494
int ncheck
Definition: pg_dump.h:287
Oid prsstart
Definition: pg_dump.h:493
char * initfdwacl
Definition: pg_dump.h:531
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:390
char oprkind
Definition: pg_dump.h:222
bool condeferred
Definition: pg_dump.h:445
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:9071
char * rtypacl
Definition: pg_dump.h:174
char * initproacl
Definition: pg_dump.h:207
char * initdefaclacl
Definition: pg_dump.h:556
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:376
DumpableObject dobj
Definition: pg_dump.h:418
CollInfo * findCollationByOid(Oid oid)
Definition: common.c:896
char * amhandler
Definition: pg_dump.h:230
Oid inhparent
Definition: pg_dump.h:487
char * rolname
Definition: pg_dump.h:200
struct _tableInfo TableInfo
DumpableObject dobj
Definition: pg_dump.h:389
char ** attfdwoptions
Definition: pg_dump.h:318
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:321
DumpableObject dobj
Definition: pg_dump.h:578
OprInfo * getOperators(Archive *fout, int *numOperators)
Definition: pg_dump.c:4697
char * tgargs
Definition: pg_dump.h:405
char evtenabled
Definition: pg_dump.h:424
static int numCollations
Definition: common.c:61
DumpableObject dobj
Definition: pg_dump.h:492
char * proacl
Definition: pg_dump.h:205
char * rproacl
Definition: pg_dump.h:206
char * blobacl
Definition: pg_dump.h:564
struct _extensionInfo ExtensionInfo
bool force_quotes
Oid tgconstrrelid
Definition: pg_dump.h:408
char * initrfdwacl
Definition: pg_dump.h:532
bool polpermissive
Definition: pg_dump.h:582
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:805
FuncInfo * findFuncByOid(Oid oid)
Definition: common.c:874
char * polname
Definition: pg_dump.h:580
Oid prslextype
Definition: pg_dump.h:497
char * initrelacl
Definition: pg_dump.h:266
DumpableObject dobj
Definition: pg_dump.h:400
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:6448
struct _constraintInfo * checkexprs
Definition: pg_dump.h:322
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:557
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:5610
TableInfo * statsexttable
Definition: pg_dump.h:383
DumpableObject dobj
Definition: pg_dump.h:537
CollInfo * getCollations(Archive *fout, int *numCollations)
Definition: pg_dump.c:4783
DumpableObject dobj
Definition: pg_dump.h:358
bool interesting
Definition: pg_dump.h:295
CatalogId catId
Definition: pg_dump.h:631
char ev_enabled
Definition: pg_dump.h:393
struct _castInfo CastInfo
struct _typeInfo TypeInfo
struct _policyInfo PolicyInfo
char castmethod
Definition: pg_dump.h:471
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:4185
bool indisclustered
Definition: pg_dump.h:365
AggInfo * getAggregates(Archive *fout, int *numAggregates)
Definition: pg_dump.c:5184
DumpableObject dobj
Definition: pg_dump.h:476
char * initsrvacl
Definition: pg_dump.h:544
struct _triggerInfo * triggers
Definition: pg_dump.h:336
char * polroles
Definition: pg_dump.h:583
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:553
Oid prsheadline
Definition: pg_dump.h:496
char * rblobacl
Definition: pg_dump.h:565
char * initrblobacl
Definition: pg_dump.h:567
DumpableObject dobj
Definition: pg_dump.h:502
void getExtendedStatistics(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6831
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6397
char * tgfname
Definition: pg_dump.h:402
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:607
char g_comment_start[10]
Definition: pg_dump.c:130
RuleInfo * getRules(Archive *fout, int *numRules)
Definition: pg_dump.c:7114
char g_comment_end[10]
Definition: pg_dump.c:131
char castcontext
Definition: pg_dump.h:470
Oid oprcode
Definition: pg_dump.h:223
char * adef_expr
Definition: pg_dump.h:344
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:3772
OpfamilyInfo * getOpfamilies(Archive *fout, int *numOpfamilies)
Definition: pg_dump.c:5097
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6502
char * defaclrole
Definition: pg_dump.h:552
char * extversion
Definition: pg_dump.h:159
DumpId getMaxDumpId(void)
Definition: common.c:622