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