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-2023, 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 
22 /*
23  * The data structures used to store system catalog information. Every
24  * dumpable object is a subclass of DumpableObject.
25  *
26  * NOTE: the structures described here live for the entire pg_dump run;
27  * and in most cases we make a struct for every object we can find in the
28  * catalogs, not only those we are actually going to dump. Hence, it's
29  * best to store a minimal amount of per-object info in these structs,
30  * and retrieve additional per-object info when and if we dump a specific
31  * object. In particular, try to avoid retrieving expensive-to-compute
32  * information until it's known to be needed. We do, however, have to
33  * store enough info to determine whether an object should be dumped and
34  * what order to dump in.
35  */
36 
37 typedef enum
38 {
39  /* When modifying this enum, update priority tables in pg_dump_sort.c! */
61  DO_FK_CONSTRAINT, /* see note for ConstraintInfo */
87 
88 /*
89  * DumpComponents is a bitmask of the potentially dumpable components of
90  * a database object: its core definition, plus optional attributes such
91  * as ACL, comments, etc. The NONE and ALL symbols are convenient
92  * shorthands.
93  */
95 #define DUMP_COMPONENT_NONE (0)
96 #define DUMP_COMPONENT_DEFINITION (1 << 0)
97 #define DUMP_COMPONENT_DATA (1 << 1)
98 #define DUMP_COMPONENT_COMMENT (1 << 2)
99 #define DUMP_COMPONENT_SECLABEL (1 << 3)
100 #define DUMP_COMPONENT_ACL (1 << 4)
101 #define DUMP_COMPONENT_POLICY (1 << 5)
102 #define DUMP_COMPONENT_USERMAP (1 << 6)
103 #define DUMP_COMPONENT_ALL (0xFFFF)
104 
105 /*
106  * component types which require us to obtain a lock on the table
107  *
108  * Note that some components only require looking at the information
109  * in the pg_catalog tables and, for those components, we do not need
110  * to lock the table. Be careful here though- some components use
111  * server-side functions which pull the latest information from
112  * SysCache and in those cases we *do* need to lock the table.
113  *
114  * We do not need locks for the COMMENT and SECLABEL components as
115  * those simply query their associated tables without using any
116  * server-side functions. We do not need locks for the ACL component
117  * as we pull that information from pg_class without using any
118  * server-side functions that use SysCache. The USERMAP component
119  * is only relevant for FOREIGN SERVERs and not tables, so no sense
120  * locking a table for that either (that can happen if we are going
121  * to dump "ALL" components for a table).
122  *
123  * We DO need locks for DEFINITION, due to various server-side
124  * functions that are used and POLICY due to pg_get_expr(). We set
125  * this up to grab the lock except in the cases we know to be safe.
126  */
127 #define DUMP_COMPONENTS_REQUIRING_LOCK (\
128  DUMP_COMPONENT_DEFINITION |\
129  DUMP_COMPONENT_DATA |\
130  DUMP_COMPONENT_POLICY)
131 
132 typedef struct _dumpableObject
133 {
135  CatalogId catId; /* zero if not a cataloged object */
136  DumpId dumpId; /* assigned by AssignDumpId() */
137  char *name; /* object name (should never be NULL) */
138  struct _namespaceInfo *namespace; /* containing namespace, or NULL */
139  DumpComponents dump; /* bitmask of components requested to dump */
140  DumpComponents dump_contains; /* as above, but for contained objects */
141  DumpComponents components; /* bitmask of components available to dump */
142  bool ext_member; /* true if object is member of extension */
143  bool depends_on_ext; /* true if object depends on an extension */
144  DumpId *dependencies; /* dumpIds of objects this one depends on */
145  int nDeps; /* number of valid dependencies */
146  int allocDeps; /* allocated size of dependencies[] */
148 
149 /*
150  * Object types that have ACLs must store them in a DumpableAcl sub-struct,
151  * which must immediately follow the DumpableObject base struct.
152  */
153 typedef struct _dumpableAcl
154 {
155  char *acl; /* the object's actual ACL string */
156  char *acldefault; /* default ACL for the object's type & owner */
157  /* these fields come from the object's pg_init_privs entry, if any: */
158  char privtype; /* entry type, 'i' or 'e'; 0 if no entry */
159  char *initprivs; /* the object's initial ACL string, or NULL */
161 
162 /* Generic struct that can be used to access any object type having an ACL */
164 {
168 
169 typedef struct _namespaceInfo
170 {
173  bool create; /* CREATE SCHEMA, or just set owner? */
174  Oid nspowner; /* OID of owner */
175  const char *rolname; /* name of owner */
177 
178 typedef struct _extensionInfo
179 {
181  char *namespace; /* schema containing extension's objects */
183  char *extversion;
184  char *extconfig; /* info about configuration tables */
187 
188 typedef struct _typeInfo
189 {
192 
193  /*
194  * Note: dobj.name is the raw pg_type.typname entry. ftypname is the
195  * result of format_type(), which will be quoted if needed, and might be
196  * schema-qualified too.
197  */
198  char *ftypname;
199  const char *rolname;
202  char typrelkind; /* 'r', 'v', 'c', etc */
203  char typtype; /* 'b', 'c', etc */
204  bool isArray; /* true if auto-generated array type */
205  bool isMultirange; /* true if auto-generated multirange type */
206  bool isDefined; /* true if typisdefined */
207  /* If needed, we'll create a "shell type" entry for it; link that here: */
208  struct _shellTypeInfo *shellType; /* shell-type entry, or NULL */
209  /* If it's a domain, we store links to its constraints here: */
213 
214 typedef struct _shellTypeInfo
215 {
217 
218  TypeInfo *baseType; /* back link to associated base type */
220 
221 typedef struct _funcInfo
222 {
225  const char *rolname;
227  int nargs;
231 
232 /* AggInfo is a superset of FuncInfo */
233 typedef struct _aggInfo
234 {
236  /* we don't require any other fields at the moment */
238 
239 typedef struct _oprInfo
240 {
242  const char *rolname;
243  char oprkind;
246 
247 typedef struct _accessMethodInfo
248 {
250  char amtype;
251  char *amhandler;
253 
254 typedef struct _opclassInfo
255 {
257  const char *rolname;
259 
260 typedef struct _opfamilyInfo
261 {
263  const char *rolname;
265 
266 typedef struct _collInfo
267 {
269  const char *rolname;
271 
272 typedef struct _convInfo
273 {
275  const char *rolname;
277 
278 typedef struct _tableInfo
279 {
280  /*
281  * These fields are collected for every table in the database.
282  */
285  const char *rolname;
286  char relkind;
287  char relpersistence; /* relation persistence */
288  bool relispopulated; /* relation is populated */
289  char relreplident; /* replica identifier */
290  char *reltablespace; /* relation tablespace */
291  char *reloptions; /* options specified by WITH (...) */
292  char *checkoption; /* WITH CHECK OPTION, if any */
293  char *toast_reloptions; /* WITH options for the TOAST table */
294  bool hasindex; /* does it have any indexes? */
295  bool hasrules; /* does it have any rules? */
296  bool hastriggers; /* does it have any triggers? */
297  bool hascolumnACLs; /* do any columns have non-default ACLs? */
298  bool rowsec; /* is row security enabled? */
299  bool forcerowsec; /* is row security forced? */
300  bool hasoids; /* does it have OIDs? */
301  uint32 frozenxid; /* table's relfrozenxid */
302  uint32 minmxid; /* table's relminmxid */
303  Oid toast_oid; /* toast table's OID, or 0 if none */
304  uint32 toast_frozenxid; /* toast table's relfrozenxid, if any */
305  uint32 toast_minmxid; /* toast table's relminmxid */
306  int ncheck; /* # of CHECK expressions */
307  Oid reltype; /* OID of table's composite type, if any */
308  Oid reloftype; /* underlying type for typed table */
309  Oid foreign_server; /* foreign server oid, if applicable */
310  /* these two are set only if table is a sequence owned by a column: */
311  Oid owning_tab; /* OID of table owning sequence */
312  int owning_col; /* attr # of column owning sequence */
314  int relpages; /* table's size in pages (from pg_class) */
315  int toastpages; /* toast table's size in pages, if any */
316 
317  bool interesting; /* true if need to collect more data */
318  bool dummy_view; /* view's real definition must be postponed */
319  bool postponed_def; /* matview must be postponed into post-data */
320  bool ispartition; /* is table a partition? */
321  bool unsafe_partitions; /* is it an unsafe partitioned table? */
322 
323  int numParents; /* number of (immediate) parent tables */
324  struct _tableInfo **parents; /* TableInfos of immediate parents */
325 
326  /*
327  * These fields are computed only if we decide the table is interesting
328  * (it's either a table to dump, or a direct parent of a dumpable table).
329  */
330  int numatts; /* number of attributes */
331  char **attnames; /* the attribute names */
332  char **atttypnames; /* attribute type names */
333  int *attstattarget; /* attribute statistics targets */
334  char *attstorage; /* attribute storage scheme */
335  char *typstorage; /* type storage scheme */
336  bool *attisdropped; /* true if attr is dropped; don't dump it */
337  char *attidentity;
339  int *attlen; /* attribute length, used by binary_upgrade */
340  char *attalign; /* attribute align, used by binary_upgrade */
341  bool *attislocal; /* true if attr has local definition */
342  char **attoptions; /* per-attribute options */
343  Oid *attcollation; /* per-attribute collation selection */
344  char *attcompression; /* per-attribute compression method */
345  char **attfdwoptions; /* per-attribute fdw options */
346  char **attmissingval; /* per attribute missing value */
347  bool *notnull; /* NOT NULL constraints on attributes */
348  bool *inhNotNull; /* true if NOT NULL is inherited */
349  struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
350  struct _constraintInfo *checkexprs; /* CHECK constraints */
351  bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
352  char *amname; /* relation access method */
353 
354  /*
355  * Stuff computed only for dumpable tables.
356  */
357  int numIndexes; /* number of indexes */
358  struct _indxInfo *indexes; /* indexes */
359  struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
360  int numTriggers; /* number of triggers for table */
361  struct _triggerInfo *triggers; /* array of TriggerInfo structs */
363 
364 typedef struct _tableAttachInfo
365 {
367  TableInfo *parentTbl; /* link to partitioned table */
368  TableInfo *partitionTbl; /* link to partition */
370 
371 typedef struct _attrDefInfo
372 {
373  DumpableObject dobj; /* note: dobj.name is name of table */
374  TableInfo *adtable; /* link to table of attribute */
375  int adnum;
376  char *adef_expr; /* decompiled DEFAULT expression */
377  bool separate; /* true if must dump as separate item */
379 
380 typedef struct _tableDataInfo
381 {
383  TableInfo *tdtable; /* link to table to dump */
384  char *filtercond; /* WHERE condition to limit rows dumped */
386 
387 typedef struct _indxInfo
388 {
390  TableInfo *indextable; /* link to table the index is for */
391  char *indexdef;
392  char *tablespace; /* tablespace in which index is stored */
393  char *indreloptions; /* options specified by WITH (...) */
394  char *indstatcols; /* column numbers with statistics */
395  char *indstatvals; /* statistic values for columns */
396  int indnkeyattrs; /* number of index key attributes */
397  int indnattrs; /* total number of index attributes */
398  Oid *indkeys; /* In spite of the name 'indkeys' this field
399  * contains both key and nonkey attributes */
403  Oid parentidx; /* if a partition, parent index OID */
404  SimplePtrList partattaches; /* if partitioned, partition attach objects */
405 
406  /* if there is an associated constraint object, its dumpId: */
409 
410 typedef struct _indexAttachInfo
411 {
413  IndxInfo *parentIdx; /* link to index on partitioned table */
414  IndxInfo *partitionIdx; /* link to index on partition */
416 
417 typedef struct _statsExtInfo
418 {
420  const char *rolname;
421  int stattarget; /* statistics target */
423 
424 typedef struct _ruleInfo
425 {
427  TableInfo *ruletable; /* link to table the rule is for */
428  char ev_type;
431  bool separate; /* true if must dump as separate item */
432  /* separate is always true for non-ON SELECT rules */
434 
435 typedef struct _triggerInfo
436 {
438  TableInfo *tgtable; /* link to table the trigger is for */
439  char *tgfname;
440  int tgtype;
441  int tgnargs;
442  char *tgargs;
447  char tgenabled;
451  char *tgdef;
453 
454 typedef struct _evttriggerInfo
455 {
457  char *evtname;
458  char *evtevent;
459  const char *evtowner;
460  char *evttags;
461  char *evtfname;
464 
465 /*
466  * struct ConstraintInfo is used for all constraint types. However we
467  * use a different objType for foreign key constraints, to make it easier
468  * to sort them the way we want.
469  *
470  * Note: condeferrable and condeferred are currently only valid for
471  * unique/primary-key constraints. Otherwise that info is in condef.
472  */
473 typedef struct _constraintInfo
474 {
476  TableInfo *contable; /* NULL if domain constraint */
477  TypeInfo *condomain; /* NULL if table constraint */
478  char contype;
479  char *condef; /* definition, if CHECK or FOREIGN KEY */
480  Oid confrelid; /* referenced table, if FOREIGN KEY */
481  DumpId conindex; /* identifies associated index if any */
482  bool condeferrable; /* true if constraint is DEFERRABLE */
483  bool condeferred; /* true if constraint is INITIALLY DEFERRED */
484  bool conislocal; /* true if constraint has local definition */
485  bool separate; /* true if must dump as separate item */
487 
488 typedef struct _procLangInfo
489 {
496  const char *lanowner;
498 
499 typedef struct _castInfo
500 {
508 
509 typedef struct _transformInfo
510 {
517 
518 /* InhInfo isn't a DumpableObject, just temporary state */
519 typedef struct _inhInfo
520 {
521  Oid inhrelid; /* OID of a child table */
522  Oid inhparent; /* OID of its parent */
524 
525 typedef struct _prsInfo
526 {
534 
535 typedef struct _dictInfo
536 {
538  const char *rolname;
542 
543 typedef struct _tmplInfo
544 {
549 
550 typedef struct _cfgInfo
551 {
553  const char *rolname;
556 
557 typedef struct _fdwInfo
558 {
561  const char *rolname;
562  char *fdwhandler;
564  char *fdwoptions;
566 
567 typedef struct _foreignServerInfo
568 {
571  const char *rolname;
573  char *srvtype;
574  char *srvversion;
575  char *srvoptions;
577 
578 typedef struct _defaultACLInfo
579 {
582  const char *defaclrole;
585 
586 typedef struct _loInfo
587 {
590  const char *rolname;
592 
593 /*
594  * The PolicyInfo struct is used to represent policies on a table and
595  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
596  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
597  * it's non-NULL then this is a regular policy definition.
598  */
599 typedef struct _policyInfo
600 {
603  char *polname; /* null indicates RLS is enabled on rel */
604  char polcmd;
606  char *polroles;
607  char *polqual;
610 
611 /*
612  * The PublicationInfo struct is used to represent publications.
613  */
614 typedef struct _PublicationInfo
615 {
617  const char *rolname;
619  bool pubinsert;
620  bool pubupdate;
621  bool pubdelete;
625 
626 /*
627  * The PublicationRelInfo struct is used to represent publication table
628  * mapping.
629  */
630 typedef struct _PublicationRelInfo
631 {
635  char *pubrelqual;
636  char *pubrattrs;
638 
639 /*
640  * The PublicationSchemaInfo struct is used to represent publication schema
641  * mapping.
642  */
644 {
649 
650 /*
651  * The SubscriptionInfo struct is used to represent subscription.
652  */
653 typedef struct _SubscriptionInfo
654 {
656  const char *rolname;
657  char *subconninfo;
658  char *subslotname;
659  char *subbinary;
660  char *substream;
663  char *suborigin;
668 
669 /*
670  * common utility functions
671  */
672 
673 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
674 
675 extern void AssignDumpId(DumpableObject *dobj);
676 extern DumpId createDumpId(void);
677 extern DumpId getMaxDumpId(void);
680 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
681 
682 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
683 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
684 
685 extern TableInfo *findTableByOid(Oid oid);
686 extern TypeInfo *findTypeByOid(Oid oid);
687 extern FuncInfo *findFuncByOid(Oid oid);
688 extern OprInfo *findOprByOid(Oid oid);
689 extern CollInfo *findCollationByOid(Oid oid);
693 
694 extern void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext);
695 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
696 
697 extern void parseOidArray(const char *str, Oid *array, int arraysize);
698 
699 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
700  DumpId preBoundaryId, DumpId postBoundaryId);
701 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
702 
703 /*
704  * version specific routines
705  */
706 extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
707 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
708 extern TypeInfo *getTypes(Archive *fout, int *numTypes);
709 extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
710 extern AggInfo *getAggregates(Archive *fout, int *numAggs);
711 extern OprInfo *getOperators(Archive *fout, int *numOprs);
712 extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
713 extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
714 extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
715 extern CollInfo *getCollations(Archive *fout, int *numCollations);
716 extern ConvInfo *getConversions(Archive *fout, int *numConversions);
717 extern TableInfo *getTables(Archive *fout, int *numTables);
718 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
719 extern InhInfo *getInherits(Archive *fout, int *numInherits);
720 extern void getPartitioningInfo(Archive *fout);
721 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
722 extern void getExtendedStatistics(Archive *fout);
723 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
724 extern RuleInfo *getRules(Archive *fout, int *numRules);
725 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
726 extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
727 extern CastInfo *getCasts(Archive *fout, int *numCasts);
728 extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
729 extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
730 extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
731 extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
732 extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
733 extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
734 extern TSConfigInfo *getTSConfigurations(Archive *fout, int *numTSConfigs);
736  int *numForeignDataWrappers);
738  int *numForeignServers);
739 extern DefaultACLInfo *getDefaultACLs(Archive *fout, int *numDefaultACLs);
740 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
741  int numExtensions);
742 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
743  int numExtensions);
744 extern EventTriggerInfo *getEventTriggers(Archive *fout, int *numEventTriggers);
745 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
747  int *numPublications);
748 extern void getPublicationNamespaces(Archive *fout);
749 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
750  int numTables);
751 extern void getSubscriptions(Archive *fout);
752 
753 #endif /* PG_DUMP_H */
unsigned int uint32
Definition: c.h:490
int DumpId
Definition: pg_backup.h:267
NamespaceInfo * getNamespaces(Archive *fout, int *numNamespaces)
Definition: pg_dump.c:5170
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7317
struct _collInfo CollInfo
struct _transformInfo TransformInfo
void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext)
Definition: common.c:984
void getPublicationNamespaces(Archive *fout)
Definition: pg_dump.c:4235
struct _opfamilyInfo OpfamilyInfo
void getPartitioningInfo(Archive *fout)
Definition: pg_dump.c:6875
struct _indxInfo IndxInfo
DefaultACLInfo * getDefaultACLs(Archive *fout, int *numDefaultACLs)
Definition: pg_dump.c:9390
struct _fdwInfo FdwInfo
struct _triggerInfo TriggerInfo
struct _tmplInfo TSTemplateInfo
struct _tableInfo TableInfo
FuncInfo * findFuncByOid(Oid oid)
Definition: common.c:875
struct _aggInfo AggInfo
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3750
struct _castInfo CastInfo
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17711
struct _tableDataInfo TableDataInfo
ForeignServerInfo * getForeignServers(Archive *fout, int *numForeignServers)
Definition: pg_dump.c:9296
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:929
struct _cfgInfo TSConfigInfo
AccessMethodInfo * getAccessMethods(Archive *fout, int *numAccessMethods)
Definition: pg_dump.c:5761
FdwInfo * getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
Definition: pg_dump.c:9206
FuncInfo * getFuncs(Archive *fout, int *numFuncs)
Definition: pg_dump.c:6112
TSConfigInfo * getTSConfigurations(Archive *fout, int *numTSConfigs)
Definition: pg_dump.c:9141
struct _dumpableObject DumpableObject
struct _accessMethodInfo AccessMethodInfo
struct _attrDefInfo AttrDefInfo
ConvInfo * getConversions(Archive *fout, int *numConversions)
Definition: pg_dump.c:5693
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6756
ExtensionInfo * findOwningExtension(CatalogId catalogId)
Definition: common.c:1008
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition: common.c:95
struct _ruleInfo RuleInfo
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:4322
AggInfo * getAggregates(Archive *fout, int *numAggs)
Definition: pg_dump.c:5966
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition: common.c:735
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6935
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:775
struct _foreignServerInfo ForeignServerInfo
DumpableObject * findObjectByDumpId(DumpId dumpId)
Definition: common.c:722
void parseOidArray(const char *str, Oid *array, int arraysize)
Definition: common.c:1032
struct _inhInfo InhInfo
struct _indexAttachInfo IndexAttachInfo
struct _procLangInfo ProcLangInfo
TSDictInfo * getTSDictionaries(Archive *fout, int *numTSDicts)
Definition: pg_dump.c:9004
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:6819
OpfamilyInfo * getOpfamilies(Archive *fout, int *numOpfamilies)
Definition: pg_dump.c:5898
void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
Definition: pg_dump.c:8352
struct _prsInfo TSParserInfo
struct _policyInfo PolicyInfo
TableInfo * findTableByOid(Oid oid)
Definition: common.c:820
struct _PublicationInfo PublicationInfo
struct _namespaceInfo NamespaceInfo
struct _shellTypeInfo ShellTypeInfo
struct _dumpableObjectWithAcl DumpableObjectWithAcl
struct _defaultACLInfo DefaultACLInfo
PublicationInfo * getPublications(Archive *fout, int *numPublications)
Definition: pg_dump.c:4035
DumpId createDumpId(void)
Definition: common.c:702
TSTemplateInfo * getTSTemplates(Archive *fout, int *numTSTemplates)
Definition: pg_dump.c:9076
ProcLangInfo * getProcLangs(Archive *fout, int *numProcLangs)
Definition: pg_dump.c:8055
struct _loInfo LoInfo
TypeInfo * getTypes(Archive *fout, int *numTypes)
Definition: pg_dump.c:5381
ExtensionInfo * findExtensionByOid(Oid oid)
Definition: common.c:947
void AssignDumpId(DumpableObject *dobj)
Definition: common.c:638
struct _evttriggerInfo EventTriggerInfo
void getExtendedStatistics(Archive *fout)
Definition: pg_dump.c:7245
struct _dumpableAcl DumpableAcl
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17804
DumpId getMaxDumpId(void)
Definition: common.c:711
OpclassInfo * getOpclasses(Archive *fout, int *numOpclasses)
Definition: pg_dump.c:5832
uint32 DumpComponents
Definition: pg_dump.h:94
CollInfo * getCollations(Archive *fout, int *numCollations)
Definition: pg_dump.c:5625
struct _typeInfo TypeInfo
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:4576
void sortDumpableObjects(DumpableObject **objs, int numObjs, DumpId preBoundaryId, DumpId postBoundaryId)
Definition: pg_dump_sort.c:319
struct _SubscriptionInfo SubscriptionInfo
struct _extensionInfo ExtensionInfo
struct _dictInfo TSDictInfo
struct _funcInfo FuncInfo
struct _opclassInfo OpclassInfo
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition: pg_dump.c:5306
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:754
struct _statsExtInfo StatsExtInfo
CollInfo * findCollationByOid(Oid oid)
Definition: common.c:911
TSParserInfo * getTSParsers(Archive *fout, int *numTSParsers)
Definition: pg_dump.c:8924
TransformInfo * getTransforms(Archive *fout, int *numTransforms)
Definition: pg_dump.c:8261
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7698
DumpableObjectType
Definition: pg_dump.h:38
@ DO_EVENT_TRIGGER
Definition: pg_dump.h:79
@ DO_REFRESH_MATVIEW
Definition: pg_dump.h:80
@ DO_POLICY
Definition: pg_dump.h:81
@ DO_CAST
Definition: pg_dump.h:63
@ DO_FOREIGN_SERVER
Definition: pg_dump.h:72
@ DO_PRE_DATA_BOUNDARY
Definition: pg_dump.h:77
@ DO_PROCLANG
Definition: pg_dump.h:62
@ DO_TYPE
Definition: pg_dump.h:42
@ DO_INDEX
Definition: pg_dump.h:55
@ DO_COLLATION
Definition: pg_dump.h:50
@ DO_LARGE_OBJECT
Definition: pg_dump.h:75
@ DO_TSCONFIG
Definition: pg_dump.h:70
@ DO_OPERATOR
Definition: pg_dump.h:46
@ DO_FK_CONSTRAINT
Definition: pg_dump.h:61
@ DO_CONSTRAINT
Definition: pg_dump.h:60
@ DO_SUBSCRIPTION
Definition: pg_dump.h:85
@ DO_DEFAULT_ACL
Definition: pg_dump.h:73
@ DO_FDW
Definition: pg_dump.h:71
@ DO_SEQUENCE_SET
Definition: pg_dump.h:65
@ DO_ATTRDEF
Definition: pg_dump.h:54
@ DO_PUBLICATION_REL
Definition: pg_dump.h:83
@ DO_TABLE_ATTACH
Definition: pg_dump.h:53
@ DO_OPCLASS
Definition: pg_dump.h:48
@ DO_INDEX_ATTACH
Definition: pg_dump.h:56
@ DO_TSTEMPLATE
Definition: pg_dump.h:69
@ DO_STATSEXT
Definition: pg_dump.h:57
@ DO_FUNC
Definition: pg_dump.h:44
@ DO_POST_DATA_BOUNDARY
Definition: pg_dump.h:78
@ DO_LARGE_OBJECT_DATA
Definition: pg_dump.h:76
@ DO_OPFAMILY
Definition: pg_dump.h:49
@ DO_TRANSFORM
Definition: pg_dump.h:74
@ DO_ACCESS_METHOD
Definition: pg_dump.h:47
@ DO_PUBLICATION_TABLE_IN_SCHEMA
Definition: pg_dump.h:84
@ DO_CONVERSION
Definition: pg_dump.h:51
@ DO_TRIGGER
Definition: pg_dump.h:59
@ DO_RULE
Definition: pg_dump.h:58
@ DO_DUMMY_TYPE
Definition: pg_dump.h:66
@ DO_TSDICT
Definition: pg_dump.h:68
@ DO_TSPARSER
Definition: pg_dump.h:67
@ DO_EXTENSION
Definition: pg_dump.h:41
@ DO_TABLE_DATA
Definition: pg_dump.h:64
@ DO_PUBLICATION
Definition: pg_dump.h:82
@ DO_TABLE
Definition: pg_dump.h:52
@ DO_NAMESPACE
Definition: pg_dump.h:40
@ DO_AGG
Definition: pg_dump.h:45
@ DO_SHELL_TYPE
Definition: pg_dump.h:43
TypeInfo * findTypeByOid(Oid oid)
Definition: common.c:856
OprInfo * getOperators(Archive *fout, int *numOprs)
Definition: pg_dump.c:5551
RuleInfo * getRules(Archive *fout, int *numRules)
Definition: pg_dump.c:7597
OprInfo * findOprByOid(Oid oid)
Definition: common.c:893
struct _PublicationRelInfo PublicationRelInfo
void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:186
struct _convInfo ConvInfo
EventTriggerInfo * getEventTriggers(Archive *fout, int *numEventTriggers)
Definition: pg_dump.c:7968
struct _constraintInfo ConstraintInfo
TableInfo * getTables(Archive *fout, int *numTables)
Definition: pg_dump.c:6310
bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno)
Definition: pg_dump.c:8906
struct _tableAttachInfo TableAttachInfo
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:800
CastInfo * getCasts(Archive *fout, int *numCasts)
Definition: pg_dump.c:8145
struct _oprInfo OprInfo
PublicationInfo * findPublicationByOid(Oid oid)
Definition: common.c:965
struct _PublicationSchemaInfo PublicationSchemaInfo
unsigned int Oid
Definition: postgres_ext.h:31
const char * rolname
Definition: pg_dump.h:617
bool puballtables
Definition: pg_dump.h:618
bool pubtruncate
Definition: pg_dump.h:622
DumpableObject dobj
Definition: pg_dump.h:616
TableInfo * pubtable
Definition: pg_dump.h:634
PublicationInfo * publication
Definition: pg_dump.h:633
DumpableObject dobj
Definition: pg_dump.h:632
NamespaceInfo * pubschema
Definition: pg_dump.h:647
DumpableObject dobj
Definition: pg_dump.h:645
PublicationInfo * publication
Definition: pg_dump.h:646
char * suborigin
Definition: pg_dump.h:663
char * subbinary
Definition: pg_dump.h:659
const char * rolname
Definition: pg_dump.h:656
char * subsynccommit
Definition: pg_dump.h:664
char * subpublications
Definition: pg_dump.h:665
char * subtwophasestate
Definition: pg_dump.h:661
char * substream
Definition: pg_dump.h:660
char * subpasswordrequired
Definition: pg_dump.h:666
char * subslotname
Definition: pg_dump.h:658
char * subdisableonerr
Definition: pg_dump.h:662
char * subconninfo
Definition: pg_dump.h:657
DumpableObject dobj
Definition: pg_dump.h:655
char * amhandler
Definition: pg_dump.h:251
DumpableObject dobj
Definition: pg_dump.h:249
FuncInfo aggfn
Definition: pg_dump.h:235
DumpableObject dobj
Definition: pg_dump.h:373
char * adef_expr
Definition: pg_dump.h:376
TableInfo * adtable
Definition: pg_dump.h:374
bool separate
Definition: pg_dump.h:377
char castmethod
Definition: pg_dump.h:506
Oid casttarget
Definition: pg_dump.h:503
char castcontext
Definition: pg_dump.h:505
DumpableObject dobj
Definition: pg_dump.h:501
Oid castsource
Definition: pg_dump.h:502
Oid castfunc
Definition: pg_dump.h:504
Oid cfgparser
Definition: pg_dump.h:554
DumpableObject dobj
Definition: pg_dump.h:552
const char * rolname
Definition: pg_dump.h:553
const char * rolname
Definition: pg_dump.h:269
DumpableObject dobj
Definition: pg_dump.h:268
TypeInfo * condomain
Definition: pg_dump.h:477
TableInfo * contable
Definition: pg_dump.h:476
bool condeferred
Definition: pg_dump.h:483
bool conislocal
Definition: pg_dump.h:484
DumpableObject dobj
Definition: pg_dump.h:475
DumpId conindex
Definition: pg_dump.h:481
bool condeferrable
Definition: pg_dump.h:482
char * condef
Definition: pg_dump.h:479
DumpableObject dobj
Definition: pg_dump.h:274
const char * rolname
Definition: pg_dump.h:275
DumpableObject dobj
Definition: pg_dump.h:580
DumpableAcl dacl
Definition: pg_dump.h:581
const char * defaclrole
Definition: pg_dump.h:582
char defaclobjtype
Definition: pg_dump.h:583
char * dictinitoption
Definition: pg_dump.h:540
DumpableObject dobj
Definition: pg_dump.h:537
const char * rolname
Definition: pg_dump.h:538
Oid dicttemplate
Definition: pg_dump.h:539
char privtype
Definition: pg_dump.h:158
char * acldefault
Definition: pg_dump.h:156
char * acl
Definition: pg_dump.h:155
char * initprivs
Definition: pg_dump.h:159
DumpableAcl dacl
Definition: pg_dump.h:166
DumpableObject dobj
Definition: pg_dump.h:165
DumpComponents dump
Definition: pg_dump.h:138
char * name
Definition: pg_dump.h:137
DumpId * dependencies
Definition: pg_dump.h:144
DumpId dumpId
Definition: pg_dump.h:136
bool ext_member
Definition: pg_dump.h:142
DumpComponents components
Definition: pg_dump.h:141
DumpableObjectType objType
Definition: pg_dump.h:134
CatalogId catId
Definition: pg_dump.h:135
DumpComponents dump_contains
Definition: pg_dump.h:140
bool depends_on_ext
Definition: pg_dump.h:143
char * evtevent
Definition: pg_dump.h:458
char * evtfname
Definition: pg_dump.h:461
char evtenabled
Definition: pg_dump.h:462
char * evtname
Definition: pg_dump.h:457
const char * evtowner
Definition: pg_dump.h:459
char * evttags
Definition: pg_dump.h:460
DumpableObject dobj
Definition: pg_dump.h:456
bool relocatable
Definition: pg_dump.h:181
char * extversion
Definition: pg_dump.h:183
DumpableObject dobj
Definition: pg_dump.h:180
char * extcondition
Definition: pg_dump.h:185
char * extconfig
Definition: pg_dump.h:184
char * fdwhandler
Definition: pg_dump.h:562
const char * rolname
Definition: pg_dump.h:561
char * fdwvalidator
Definition: pg_dump.h:563
char * fdwoptions
Definition: pg_dump.h:564
DumpableAcl dacl
Definition: pg_dump.h:560
DumpableObject dobj
Definition: pg_dump.h:559
DumpableAcl dacl
Definition: pg_dump.h:570
char * srvoptions
Definition: pg_dump.h:575
DumpableObject dobj
Definition: pg_dump.h:569
const char * rolname
Definition: pg_dump.h:571
char * srvversion
Definition: pg_dump.h:574
Oid lang
Definition: pg_dump.h:226
const char * rolname
Definition: pg_dump.h:225
Oid * argtypes
Definition: pg_dump.h:228
Oid prorettype
Definition: pg_dump.h:229
DumpableObject dobj
Definition: pg_dump.h:223
int nargs
Definition: pg_dump.h:227
DumpableAcl dacl
Definition: pg_dump.h:224
IndxInfo * partitionIdx
Definition: pg_dump.h:414
DumpableObject dobj
Definition: pg_dump.h:412
IndxInfo * parentIdx
Definition: pg_dump.h:413
bool indisreplident
Definition: pg_dump.h:401
int indnkeyattrs
Definition: pg_dump.h:396
char * indstatvals
Definition: pg_dump.h:395
char * indstatcols
Definition: pg_dump.h:394
int indnattrs
Definition: pg_dump.h:397
TableInfo * indextable
Definition: pg_dump.h:390
Oid parentidx
Definition: pg_dump.h:403
Oid * indkeys
Definition: pg_dump.h:398
char * indreloptions
Definition: pg_dump.h:393
DumpId indexconstraint
Definition: pg_dump.h:407
bool indisclustered
Definition: pg_dump.h:400
SimplePtrList partattaches
Definition: pg_dump.h:404
char * tablespace
Definition: pg_dump.h:392
bool indnullsnotdistinct
Definition: pg_dump.h:402
char * indexdef
Definition: pg_dump.h:391
DumpableObject dobj
Definition: pg_dump.h:389
Oid inhparent
Definition: pg_dump.h:522
Oid inhrelid
Definition: pg_dump.h:521
const char * rolname
Definition: pg_dump.h:590
DumpableObject dobj
Definition: pg_dump.h:588
DumpableAcl dacl
Definition: pg_dump.h:589
DumpableObject dobj
Definition: pg_dump.h:171
DumpableAcl dacl
Definition: pg_dump.h:172
const char * rolname
Definition: pg_dump.h:175
DumpableObject dobj
Definition: pg_dump.h:256
const char * rolname
Definition: pg_dump.h:257
const char * rolname
Definition: pg_dump.h:263
DumpableObject dobj
Definition: pg_dump.h:262
DumpableObject dobj
Definition: pg_dump.h:241
char oprkind
Definition: pg_dump.h:243
Oid oprcode
Definition: pg_dump.h:244
const char * rolname
Definition: pg_dump.h:242
TableInfo * poltable
Definition: pg_dump.h:602
char * polqual
Definition: pg_dump.h:607
char polcmd
Definition: pg_dump.h:604
char * polroles
Definition: pg_dump.h:606
char * polwithcheck
Definition: pg_dump.h:608
DumpableObject dobj
Definition: pg_dump.h:601
bool polpermissive
Definition: pg_dump.h:605
char * polname
Definition: pg_dump.h:603
Oid lanvalidator
Definition: pg_dump.h:495
DumpableAcl dacl
Definition: pg_dump.h:491
DumpableObject dobj
Definition: pg_dump.h:490
Oid laninline
Definition: pg_dump.h:494
const char * lanowner
Definition: pg_dump.h:496
Oid lanplcallfoid
Definition: pg_dump.h:493
bool lanpltrusted
Definition: pg_dump.h:492
DumpableObject dobj
Definition: pg_dump.h:527
Oid prstoken
Definition: pg_dump.h:529
Oid prslextype
Definition: pg_dump.h:532
Oid prsheadline
Definition: pg_dump.h:531
Oid prsstart
Definition: pg_dump.h:528
Oid prsend
Definition: pg_dump.h:530
DumpableObject dobj
Definition: pg_dump.h:426
bool separate
Definition: pg_dump.h:431
char ev_enabled
Definition: pg_dump.h:430
bool is_instead
Definition: pg_dump.h:429
TableInfo * ruletable
Definition: pg_dump.h:427
char ev_type
Definition: pg_dump.h:428
TypeInfo * baseType
Definition: pg_dump.h:218
DumpableObject dobj
Definition: pg_dump.h:216
int stattarget
Definition: pg_dump.h:421
const char * rolname
Definition: pg_dump.h:420
DumpableObject dobj
Definition: pg_dump.h:419
TableInfo * partitionTbl
Definition: pg_dump.h:368
DumpableObject dobj
Definition: pg_dump.h:366
TableInfo * parentTbl
Definition: pg_dump.h:367
TableInfo * tdtable
Definition: pg_dump.h:383
DumpableObject dobj
Definition: pg_dump.h:382
char * filtercond
Definition: pg_dump.h:384
char * attidentity
Definition: pg_dump.h:337
char * reltablespace
Definition: pg_dump.h:290
int ncheck
Definition: pg_dump.h:306
bool ispartition
Definition: pg_dump.h:320
struct _indxInfo * indexes
Definition: pg_dump.h:358
bool * attislocal
Definition: pg_dump.h:341
DumpableObject dobj
Definition: pg_dump.h:283
bool is_identity_sequence
Definition: pg_dump.h:313
Oid reloftype
Definition: pg_dump.h:308
int numParents
Definition: pg_dump.h:323
bool interesting
Definition: pg_dump.h:317
char * toast_reloptions
Definition: pg_dump.h:293
struct _tableInfo ** parents
Definition: pg_dump.h:324
DumpableAcl dacl
Definition: pg_dump.h:284
bool relispopulated
Definition: pg_dump.h:288
char * attgenerated
Definition: pg_dump.h:338
int * attlen
Definition: pg_dump.h:339
Oid reltype
Definition: pg_dump.h:307
char ** attfdwoptions
Definition: pg_dump.h:345
bool hasoids
Definition: pg_dump.h:300
Oid toast_oid
Definition: pg_dump.h:303
Oid foreign_server
Definition: pg_dump.h:309
bool hasrules
Definition: pg_dump.h:295
struct _triggerInfo * triggers
Definition: pg_dump.h:361
bool * attisdropped
Definition: pg_dump.h:336
bool needs_override
Definition: pg_dump.h:351
struct _constraintInfo * checkexprs
Definition: pg_dump.h:350
int * attstattarget
Definition: pg_dump.h:333
uint32 frozenxid
Definition: pg_dump.h:301
char * typstorage
Definition: pg_dump.h:335
int owning_col
Definition: pg_dump.h:312
char * checkoption
Definition: pg_dump.h:292
int numatts
Definition: pg_dump.h:330
bool hastriggers
Definition: pg_dump.h:296
const char * rolname
Definition: pg_dump.h:285
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:349
char ** attoptions
Definition: pg_dump.h:342
char relreplident
Definition: pg_dump.h:289
int numTriggers
Definition: pg_dump.h:360
uint32 minmxid
Definition: pg_dump.h:302
Oid * attcollation
Definition: pg_dump.h:343
char * attstorage
Definition: pg_dump.h:334
int toastpages
Definition: pg_dump.h:315
bool * notnull
Definition: pg_dump.h:347
Oid owning_tab
Definition: pg_dump.h:311
struct _tableDataInfo * dataObj
Definition: pg_dump.h:359
char * amname
Definition: pg_dump.h:352
bool dummy_view
Definition: pg_dump.h:318
bool forcerowsec
Definition: pg_dump.h:299
bool hascolumnACLs
Definition: pg_dump.h:297
char ** atttypnames
Definition: pg_dump.h:332
char ** attmissingval
Definition: pg_dump.h:346
char relpersistence
Definition: pg_dump.h:287
char ** attnames
Definition: pg_dump.h:331
char relkind
Definition: pg_dump.h:286
bool hasindex
Definition: pg_dump.h:294
bool unsafe_partitions
Definition: pg_dump.h:321
char * reloptions
Definition: pg_dump.h:291
int numIndexes
Definition: pg_dump.h:357
int relpages
Definition: pg_dump.h:314
uint32 toast_frozenxid
Definition: pg_dump.h:304
uint32 toast_minmxid
Definition: pg_dump.h:305
char * attalign
Definition: pg_dump.h:340
char * attcompression
Definition: pg_dump.h:344
bool postponed_def
Definition: pg_dump.h:319
bool rowsec
Definition: pg_dump.h:298
bool * inhNotNull
Definition: pg_dump.h:348
Oid tmpllexize
Definition: pg_dump.h:547
Oid tmplinit
Definition: pg_dump.h:546
DumpableObject dobj
Definition: pg_dump.h:545
DumpableObject dobj
Definition: pg_dump.h:511
Oid trffromsql
Definition: pg_dump.h:514
int tgtype
Definition: pg_dump.h:440
TableInfo * tgtable
Definition: pg_dump.h:438
bool tgdeferrable
Definition: pg_dump.h:449
DumpableObject dobj
Definition: pg_dump.h:437
char * tgconstrname
Definition: pg_dump.h:444
int tgnargs
Definition: pg_dump.h:441
char tgenabled
Definition: pg_dump.h:447
Oid tgconstrrelid
Definition: pg_dump.h:445
char * tgdef
Definition: pg_dump.h:451
char * tgfname
Definition: pg_dump.h:439
bool tgispartition
Definition: pg_dump.h:448
char * tgargs
Definition: pg_dump.h:442
bool tgisconstraint
Definition: pg_dump.h:443
bool tginitdeferred
Definition: pg_dump.h:450
char * tgconstrrelname
Definition: pg_dump.h:446
bool isMultirange
Definition: pg_dump.h:205
struct _constraintInfo * domChecks
Definition: pg_dump.h:211
DumpableAcl dacl
Definition: pg_dump.h:191
DumpableObject dobj
Definition: pg_dump.h:190
bool isDefined
Definition: pg_dump.h:206
char * ftypname
Definition: pg_dump.h:198
char typrelkind
Definition: pg_dump.h:202
Oid typelem
Definition: pg_dump.h:200
struct _shellTypeInfo * shellType
Definition: pg_dump.h:208
int nDomChecks
Definition: pg_dump.h:210
char typtype
Definition: pg_dump.h:203
const char * rolname
Definition: pg_dump.h:199
Oid typrelid
Definition: pg_dump.h:201
bool isArray
Definition: pg_dump.h:204