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-2024, 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 */
86  DO_SUBSCRIPTION_REL, /* see note for SubRelInfo */
88 
89 /*
90  * DumpComponents is a bitmask of the potentially dumpable components of
91  * a database object: its core definition, plus optional attributes such
92  * as ACL, comments, etc. The NONE and ALL symbols are convenient
93  * shorthands.
94  */
96 #define DUMP_COMPONENT_NONE (0)
97 #define DUMP_COMPONENT_DEFINITION (1 << 0)
98 #define DUMP_COMPONENT_DATA (1 << 1)
99 #define DUMP_COMPONENT_COMMENT (1 << 2)
100 #define DUMP_COMPONENT_SECLABEL (1 << 3)
101 #define DUMP_COMPONENT_ACL (1 << 4)
102 #define DUMP_COMPONENT_POLICY (1 << 5)
103 #define DUMP_COMPONENT_USERMAP (1 << 6)
104 #define DUMP_COMPONENT_ALL (0xFFFF)
105 
106 /*
107  * component types which require us to obtain a lock on the table
108  *
109  * Note that some components only require looking at the information
110  * in the pg_catalog tables and, for those components, we do not need
111  * to lock the table. Be careful here though- some components use
112  * server-side functions which pull the latest information from
113  * SysCache and in those cases we *do* need to lock the table.
114  *
115  * We do not need locks for the COMMENT and SECLABEL components as
116  * those simply query their associated tables without using any
117  * server-side functions. We do not need locks for the ACL component
118  * as we pull that information from pg_class without using any
119  * server-side functions that use SysCache. The USERMAP component
120  * is only relevant for FOREIGN SERVERs and not tables, so no sense
121  * locking a table for that either (that can happen if we are going
122  * to dump "ALL" components for a table).
123  *
124  * We DO need locks for DEFINITION, due to various server-side
125  * functions that are used and POLICY due to pg_get_expr(). We set
126  * this up to grab the lock except in the cases we know to be safe.
127  */
128 #define DUMP_COMPONENTS_REQUIRING_LOCK (\
129  DUMP_COMPONENT_DEFINITION |\
130  DUMP_COMPONENT_DATA |\
131  DUMP_COMPONENT_POLICY)
132 
133 typedef struct _dumpableObject
134 {
136  CatalogId catId; /* zero if not a cataloged object */
137  DumpId dumpId; /* assigned by AssignDumpId() */
138  char *name; /* object name (should never be NULL) */
139  struct _namespaceInfo *namespace; /* containing namespace, or NULL */
140  DumpComponents dump; /* bitmask of components requested to dump */
141  DumpComponents dump_contains; /* as above, but for contained objects */
142  DumpComponents components; /* bitmask of components available to dump */
143  bool ext_member; /* true if object is member of extension */
144  bool depends_on_ext; /* true if object depends on an extension */
145  DumpId *dependencies; /* dumpIds of objects this one depends on */
146  int nDeps; /* number of valid dependencies */
147  int allocDeps; /* allocated size of dependencies[] */
149 
150 /*
151  * Object types that have ACLs must store them in a DumpableAcl sub-struct,
152  * which must immediately follow the DumpableObject base struct.
153  */
154 typedef struct _dumpableAcl
155 {
156  char *acl; /* the object's actual ACL string */
157  char *acldefault; /* default ACL for the object's type & owner */
158  /* these fields come from the object's pg_init_privs entry, if any: */
159  char privtype; /* entry type, 'i' or 'e'; 0 if no entry */
160  char *initprivs; /* the object's initial ACL string, or NULL */
162 
163 /* Generic struct that can be used to access any object type having an ACL */
165 {
169 
170 typedef struct _namespaceInfo
171 {
174  bool create; /* CREATE SCHEMA, or just set owner? */
175  Oid nspowner; /* OID of owner */
176  const char *rolname; /* name of owner */
178 
179 typedef struct _extensionInfo
180 {
182  char *namespace; /* schema containing extension's objects */
184  char *extversion;
185  char *extconfig; /* info about configuration tables */
188 
189 typedef struct _typeInfo
190 {
193 
194  /*
195  * Note: dobj.name is the raw pg_type.typname entry. ftypname is the
196  * result of format_type(), which will be quoted if needed, and might be
197  * schema-qualified too.
198  */
199  char *ftypname;
200  const char *rolname;
204  char typrelkind; /* 'r', 'v', 'c', etc */
205  char typtype; /* 'b', 'c', etc */
206  bool isArray; /* true if auto-generated array type */
207  bool isMultirange; /* true if auto-generated multirange type */
208  bool isDefined; /* true if typisdefined */
209  /* If needed, we'll create a "shell type" entry for it; link that here: */
210  struct _shellTypeInfo *shellType; /* shell-type entry, or NULL */
211  /* If it's a domain, we store links to its constraints here: */
215 
216 typedef struct _shellTypeInfo
217 {
219 
220  TypeInfo *baseType; /* back link to associated base type */
222 
223 typedef struct _funcInfo
224 {
227  const char *rolname;
229  int nargs;
232  bool postponed_def; /* function must be postponed into post-data */
234 
235 /* AggInfo is a superset of FuncInfo */
236 typedef struct _aggInfo
237 {
239  /* we don't require any other fields at the moment */
241 
242 typedef struct _oprInfo
243 {
245  const char *rolname;
246  char oprkind;
249 
250 typedef struct _accessMethodInfo
251 {
253  char amtype;
254  char *amhandler;
256 
257 typedef struct _opclassInfo
258 {
260  const char *rolname;
262 
263 typedef struct _opfamilyInfo
264 {
266  const char *rolname;
268 
269 typedef struct _collInfo
270 {
272  const char *rolname;
274 
275 typedef struct _convInfo
276 {
278  const char *rolname;
280 
281 typedef struct _tableInfo
282 {
283  /*
284  * These fields are collected for every table in the database.
285  */
288  const char *rolname;
289  char relkind;
290  char relpersistence; /* relation persistence */
291  bool relispopulated; /* relation is populated */
292  char relreplident; /* replica identifier */
293  char *reltablespace; /* relation tablespace */
294  char *reloptions; /* options specified by WITH (...) */
295  char *checkoption; /* WITH CHECK OPTION, if any */
296  char *toast_reloptions; /* WITH options for the TOAST table */
297  bool hasindex; /* does it have any indexes? */
298  bool hasrules; /* does it have any rules? */
299  bool hastriggers; /* does it have any triggers? */
300  bool hascolumnACLs; /* do any columns have non-default ACLs? */
301  bool rowsec; /* is row security enabled? */
302  bool forcerowsec; /* is row security forced? */
303  bool hasoids; /* does it have OIDs? */
304  uint32 frozenxid; /* table's relfrozenxid */
305  uint32 minmxid; /* table's relminmxid */
306  Oid toast_oid; /* toast table's OID, or 0 if none */
307  uint32 toast_frozenxid; /* toast table's relfrozenxid, if any */
308  uint32 toast_minmxid; /* toast table's relminmxid */
309  int ncheck; /* # of CHECK expressions */
310  Oid reltype; /* OID of table's composite type, if any */
311  Oid reloftype; /* underlying type for typed table */
312  Oid foreign_server; /* foreign server oid, if applicable */
313  /* these two are set only if table is a sequence owned by a column: */
314  Oid owning_tab; /* OID of table owning sequence */
315  int owning_col; /* attr # of column owning sequence */
317  int relpages; /* table's size in pages (from pg_class) */
318  int toastpages; /* toast table's size in pages, if any */
319 
320  bool interesting; /* true if need to collect more data */
321  bool dummy_view; /* view's real definition must be postponed */
322  bool postponed_def; /* matview must be postponed into post-data */
323  bool ispartition; /* is table a partition? */
324  bool unsafe_partitions; /* is it an unsafe partitioned table? */
325 
326  int numParents; /* number of (immediate) parent tables */
327  struct _tableInfo **parents; /* TableInfos of immediate parents */
328 
329  /*
330  * These fields are computed only if we decide the table is interesting
331  * (it's either a table to dump, or a direct parent of a dumpable table).
332  */
333  int numatts; /* number of attributes */
334  char **attnames; /* the attribute names */
335  char **atttypnames; /* attribute type names */
336  int *attstattarget; /* attribute statistics targets */
337  char *attstorage; /* attribute storage scheme */
338  char *typstorage; /* type storage scheme */
339  bool *attisdropped; /* true if attr is dropped; don't dump it */
340  char *attidentity;
342  int *attlen; /* attribute length, used by binary_upgrade */
343  char *attalign; /* attribute align, used by binary_upgrade */
344  bool *attislocal; /* true if attr has local definition */
345  char **attoptions; /* per-attribute options */
346  Oid *attcollation; /* per-attribute collation selection */
347  char *attcompression; /* per-attribute compression method */
348  char **attfdwoptions; /* per-attribute fdw options */
349  char **attmissingval; /* per attribute missing value */
350  bool *notnull; /* not-null constraints on attributes */
351  bool *inhNotNull; /* true if NOT NULL is inherited */
352  struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
353  struct _constraintInfo *checkexprs; /* CHECK constraints */
354  bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
355  char *amname; /* relation access method */
356 
357  /*
358  * Stuff computed only for dumpable tables.
359  */
360  int numIndexes; /* number of indexes */
361  struct _indxInfo *indexes; /* indexes */
362  struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
363  int numTriggers; /* number of triggers for table */
364  struct _triggerInfo *triggers; /* array of TriggerInfo structs */
366 
367 typedef struct _tableAttachInfo
368 {
370  TableInfo *parentTbl; /* link to partitioned table */
371  TableInfo *partitionTbl; /* link to partition */
373 
374 typedef struct _attrDefInfo
375 {
376  DumpableObject dobj; /* note: dobj.name is name of table */
377  TableInfo *adtable; /* link to table of attribute */
378  int adnum;
379  char *adef_expr; /* decompiled DEFAULT expression */
380  bool separate; /* true if must dump as separate item */
382 
383 typedef struct _tableDataInfo
384 {
386  TableInfo *tdtable; /* link to table to dump */
387  char *filtercond; /* WHERE condition to limit rows dumped */
389 
390 typedef struct _indxInfo
391 {
393  TableInfo *indextable; /* link to table the index is for */
394  char *indexdef;
395  char *tablespace; /* tablespace in which index is stored */
396  char *indreloptions; /* options specified by WITH (...) */
397  char *indstatcols; /* column numbers with statistics */
398  char *indstatvals; /* statistic values for columns */
399  int indnkeyattrs; /* number of index key attributes */
400  int indnattrs; /* total number of index attributes */
401  Oid *indkeys; /* In spite of the name 'indkeys' this field
402  * contains both key and nonkey attributes */
406  Oid parentidx; /* if a partition, parent index OID */
407  SimplePtrList partattaches; /* if partitioned, partition attach objects */
408 
409  /* if there is an associated constraint object, its dumpId: */
412 
413 typedef struct _indexAttachInfo
414 {
416  IndxInfo *parentIdx; /* link to index on partitioned table */
417  IndxInfo *partitionIdx; /* link to index on partition */
419 
420 typedef struct _statsExtInfo
421 {
423  const char *rolname; /* owner */
424  TableInfo *stattable; /* link to table the stats are for */
425  int stattarget; /* statistics target */
427 
428 typedef struct _ruleInfo
429 {
431  TableInfo *ruletable; /* link to table the rule is for */
432  char ev_type;
435  bool separate; /* true if must dump as separate item */
436  /* separate is always true for non-ON SELECT rules */
438 
439 typedef struct _triggerInfo
440 {
442  TableInfo *tgtable; /* link to table the trigger is for */
443  char tgenabled;
445  char *tgdef;
447 
448 typedef struct _evttriggerInfo
449 {
451  char *evtname;
452  char *evtevent;
453  const char *evtowner;
454  char *evttags;
455  char *evtfname;
458 
459 /*
460  * struct ConstraintInfo is used for all constraint types. However we
461  * use a different objType for foreign key constraints, to make it easier
462  * to sort them the way we want.
463  *
464  * Note: condeferrable and condeferred are currently only valid for
465  * unique/primary-key constraints. Otherwise that info is in condef.
466  */
467 typedef struct _constraintInfo
468 {
470  TableInfo *contable; /* NULL if domain constraint */
471  TypeInfo *condomain; /* NULL if table constraint */
472  char contype;
473  char *condef; /* definition, if CHECK or FOREIGN KEY */
474  Oid confrelid; /* referenced table, if FOREIGN KEY */
475  DumpId conindex; /* identifies associated index if any */
476  bool condeferrable; /* true if constraint is DEFERRABLE */
477  bool condeferred; /* true if constraint is INITIALLY DEFERRED */
478  bool conperiod; /* true if the constraint is WITHOUT OVERLAPS */
479  bool conislocal; /* true if constraint has local definition */
480  bool separate; /* true if must dump as separate item */
482 
483 typedef struct _procLangInfo
484 {
491  const char *lanowner;
493 
494 typedef struct _castInfo
495 {
503 
504 typedef struct _transformInfo
505 {
512 
513 /* InhInfo isn't a DumpableObject, just temporary state */
514 typedef struct _inhInfo
515 {
516  Oid inhrelid; /* OID of a child table */
517  Oid inhparent; /* OID of its parent */
519 
520 typedef struct _prsInfo
521 {
529 
530 typedef struct _dictInfo
531 {
533  const char *rolname;
537 
538 typedef struct _tmplInfo
539 {
544 
545 typedef struct _cfgInfo
546 {
548  const char *rolname;
551 
552 typedef struct _fdwInfo
553 {
556  const char *rolname;
557  char *fdwhandler;
559  char *fdwoptions;
561 
562 typedef struct _foreignServerInfo
563 {
566  const char *rolname;
568  char *srvtype;
569  char *srvversion;
570  char *srvoptions;
572 
573 typedef struct _defaultACLInfo
574 {
577  const char *defaclrole;
580 
581 /*
582  * LoInfo represents a group of large objects (blobs) that share the same
583  * owner and ACL setting. dobj.components has the DUMP_COMPONENT_COMMENT bit
584  * set if any blob in the group has a comment; similarly for sec labels.
585  * If there are many blobs with the same owner/ACL, we can divide them into
586  * multiple LoInfo groups, which will each spawn a BLOB METADATA and a BLOBS
587  * (data) TOC entry. This allows more parallelism during restore.
588  */
589 typedef struct _loInfo
590 {
593  const char *rolname;
594  int numlos;
597 
598 /*
599  * The PolicyInfo struct is used to represent policies on a table and
600  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
601  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
602  * it's non-NULL then this is a regular policy definition.
603  */
604 typedef struct _policyInfo
605 {
608  char *polname; /* null indicates RLS is enabled on rel */
609  char polcmd;
611  char *polroles;
612  char *polqual;
615 
616 /*
617  * The PublicationInfo struct is used to represent publications.
618  */
619 typedef struct _PublicationInfo
620 {
622  const char *rolname;
624  bool pubinsert;
625  bool pubupdate;
626  bool pubdelete;
630 
631 /*
632  * The PublicationRelInfo struct is used to represent publication table
633  * mapping.
634  */
635 typedef struct _PublicationRelInfo
636 {
640  char *pubrelqual;
641  char *pubrattrs;
643 
644 /*
645  * The PublicationSchemaInfo struct is used to represent publication schema
646  * mapping.
647  */
649 {
654 
655 /*
656  * The SubscriptionInfo struct is used to represent subscription.
657  */
658 typedef struct _SubscriptionInfo
659 {
661  const char *rolname;
662  char *subenabled;
663  char *subbinary;
664  char *substream;
669  char *subconninfo;
670  char *subslotname;
673  char *suborigin;
675  char *subfailover;
677 
678 /*
679  * The SubRelInfo struct is used to represent a subscription relation.
680  *
681  * XXX Currently, the subscription tables are added to the subscription after
682  * enabling the subscription in binary-upgrade mode. As the apply workers will
683  * not be started in binary_upgrade mode the ordering of enable subscription
684  * does not matter. The order of adding the subscription tables to the
685  * subscription and enabling the subscription should be taken care of if this
686  * feature will be supported in a non-binary-upgrade mode in the future.
687  */
688 typedef struct _SubRelInfo
689 {
694  char *srsublsn;
696 
697 /*
698  * common utility functions
699  */
700 
701 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
702 
703 extern void AssignDumpId(DumpableObject *dobj);
704 extern void recordAdditionalCatalogID(CatalogId catId, DumpableObject *dobj);
705 extern DumpId createDumpId(void);
706 extern DumpId getMaxDumpId(void);
709 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
710 
711 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
712 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
713 
714 extern TableInfo *findTableByOid(Oid oid);
715 extern TypeInfo *findTypeByOid(Oid oid);
716 extern FuncInfo *findFuncByOid(Oid oid);
717 extern OprInfo *findOprByOid(Oid oid);
718 extern CollInfo *findCollationByOid(Oid oid);
723 
724 extern void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext);
725 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
726 
727 extern void parseOidArray(const char *str, Oid *array, int arraysize);
728 
729 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
730  DumpId preBoundaryId, DumpId postBoundaryId);
731 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
732 
733 /*
734  * version specific routines
735  */
736 extern void getNamespaces(Archive *fout);
737 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
738 extern void getTypes(Archive *fout);
739 extern void getFuncs(Archive *fout);
740 extern void getAggregates(Archive *fout);
741 extern void getOperators(Archive *fout);
742 extern void getAccessMethods(Archive *fout);
743 extern void getOpclasses(Archive *fout);
744 extern void getOpfamilies(Archive *fout);
745 extern void getCollations(Archive *fout);
746 extern void getConversions(Archive *fout);
747 extern TableInfo *getTables(Archive *fout, int *numTables);
748 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
749 extern InhInfo *getInherits(Archive *fout, int *numInherits);
750 extern void getPartitioningInfo(Archive *fout);
751 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
752 extern void getExtendedStatistics(Archive *fout);
753 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
754 extern void getRules(Archive *fout);
755 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
756 extern void getProcLangs(Archive *fout);
757 extern void getCasts(Archive *fout);
758 extern void getTransforms(Archive *fout);
759 extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
760 extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
761 extern void getTSParsers(Archive *fout);
762 extern void getTSDictionaries(Archive *fout);
763 extern void getTSTemplates(Archive *fout);
764 extern void getTSConfigurations(Archive *fout);
765 extern void getForeignDataWrappers(Archive *fout);
766 extern void getForeignServers(Archive *fout);
767 extern void getDefaultACLs(Archive *fout);
768 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
769  int numExtensions);
770 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
771  int numExtensions);
772 extern void getEventTriggers(Archive *fout);
773 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
774 extern void getPublications(Archive *fout);
775 extern void getPublicationNamespaces(Archive *fout);
776 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
777  int numTables);
778 extern void getSubscriptions(Archive *fout);
779 extern void getSubscriptionTables(Archive *fout);
780 
781 #endif /* PG_DUMP_H */
unsigned int uint32
Definition: c.h:506
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:401
const char * str
int DumpId
Definition: pg_backup.h:271
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7798
struct _collInfo CollInfo
void recordAdditionalCatalogID(CatalogId catId, DumpableObject *dobj)
Definition: common.c:684
struct _transformInfo TransformInfo
void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext)
Definition: common.c:1010
void getPublicationNamespaces(Archive *fout)
Definition: pg_dump.c:4466
struct _opfamilyInfo OpfamilyInfo
void getPartitioningInfo(Archive *fout)
Definition: pg_dump.c:7339
struct _indxInfo IndxInfo
struct _fdwInfo FdwInfo
struct _triggerInfo TriggerInfo
struct _tmplInfo TSTemplateInfo
struct _tableInfo TableInfo
FuncInfo * findFuncByOid(Oid oid)
Definition: common.c:883
void getForeignDataWrappers(Archive *fout)
Definition: pg_dump.c:9555
struct _aggInfo AggInfo
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3984
struct _castInfo CastInfo
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:18167
struct _tableDataInfo TableDataInfo
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:937
struct _cfgInfo TSConfigInfo
void getTypes(Archive *fout)
Definition: pg_dump.c:5895
struct _dumpableObject DumpableObject
struct _accessMethodInfo AccessMethodInfo
struct _attrDefInfo AttrDefInfo
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7220
void getOpclasses(Archive *fout)
Definition: pg_dump.c:6316
void getForeignServers(Archive *fout)
Definition: pg_dump.c:9639
void getFuncs(Archive *fout)
Definition: pg_dump.c:6579
SubscriptionInfo * findSubscriptionByOid(Oid oid)
Definition: common.c:991
void getTSDictionaries(Archive *fout)
Definition: pg_dump.c:9371
ExtensionInfo * findOwningExtension(CatalogId catalogId)
Definition: common.c:1034
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition: common.c:98
struct _ruleInfo RuleInfo
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:4553
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition: common.c:743
void getCasts(Archive *fout)
Definition: pg_dump.c:8531
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7399
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:783
void getTSConfigurations(Archive *fout)
Definition: pg_dump.c:9496
struct _foreignServerInfo ForeignServerInfo
DumpableObject * findObjectByDumpId(DumpId dumpId)
Definition: common.c:730
void parseOidArray(const char *str, Oid *array, int arraysize)
Definition: common.c:1058
struct _inhInfo InhInfo
struct _indexAttachInfo IndexAttachInfo
struct _SubRelInfo SubRelInfo
struct _procLangInfo ProcLangInfo
void getAccessMethods(Archive *fout)
Definition: pg_dump.c:6254
void getConversions(Archive *fout)
Definition: pg_dump.c:6192
void getRules(Archive *fout)
Definition: pg_dump.c:8076
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:7283
void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
Definition: pg_dump.c:8725
struct _prsInfo TSParserInfo
struct _policyInfo PolicyInfo
TableInfo * findTableByOid(Oid oid)
Definition: common.c:828
struct _PublicationInfo PublicationInfo
void getSubscriptionTables(Archive *fout)
Definition: pg_dump.c:5029
void getCollations(Archive *fout)
Definition: pg_dump.c:6130
struct _namespaceInfo NamespaceInfo
void getAggregates(Archive *fout)
Definition: pg_dump.c:6438
struct _shellTypeInfo ShellTypeInfo
void getNamespaces(Archive *fout)
Definition: pg_dump.c:5688
void getPublications(Archive *fout)
Definition: pg_dump.c:4269
void getTSParsers(Archive *fout)
Definition: pg_dump.c:9297
struct _dumpableObjectWithAcl DumpableObjectWithAcl
struct _defaultACLInfo DefaultACLInfo
DumpId createDumpId(void)
Definition: common.c:710
struct _loInfo LoInfo
ExtensionInfo * findExtensionByOid(Oid oid)
Definition: common.c:955
void AssignDumpId(DumpableObject *dobj)
Definition: common.c:622
struct _evttriggerInfo EventTriggerInfo
void getExtendedStatistics(Archive *fout)
Definition: pg_dump.c:7719
struct _dumpableAcl DumpableAcl
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:18260
DumpId getMaxDumpId(void)
Definition: common.c:719
void getDefaultACLs(Archive *fout)
Definition: pg_dump.c:9727
uint32 DumpComponents
Definition: pg_dump.h:95
struct _typeInfo TypeInfo
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:4829
void sortDumpableObjects(DumpableObject **objs, int numObjs, DumpId preBoundaryId, DumpId postBoundaryId)
Definition: pg_dump_sort.c:333
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:5820
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:762
struct _statsExtInfo StatsExtInfo
CollInfo * findCollationByOid(Oid oid)
Definition: common.c:919
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:8173
void getTransforms(Archive *fout)
Definition: pg_dump.c:8641
void getEventTriggers(Archive *fout)
Definition: pg_dump.c:8369
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_SUBSCRIPTION_REL
Definition: pg_dump.h:86
@ 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:864
OprInfo * findOprByOid(Oid oid)
Definition: common.c:901
struct _PublicationRelInfo PublicationRelInfo
void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
Definition: pg_dump_sort.c:189
struct _convInfo ConvInfo
struct _constraintInfo ConstraintInfo
TableInfo * getTables(Archive *fout, int *numTables)
Definition: pg_dump.c:6774
void getTSTemplates(Archive *fout)
Definition: pg_dump.c:9437
void getProcLangs(Archive *fout)
Definition: pg_dump.c:8447
bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno)
Definition: pg_dump.c:9282
struct _tableAttachInfo TableAttachInfo
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:808
void getOperators(Archive *fout)
Definition: pg_dump.c:6062
void getOpfamilies(Archive *fout)
Definition: pg_dump.c:6376
struct _oprInfo OprInfo
PublicationInfo * findPublicationByOid(Oid oid)
Definition: common.c:973
struct _PublicationSchemaInfo PublicationSchemaInfo
unsigned int Oid
Definition: postgres_ext.h:31
const char * rolname
Definition: pg_dump.h:622
bool puballtables
Definition: pg_dump.h:623
bool pubtruncate
Definition: pg_dump.h:627
DumpableObject dobj
Definition: pg_dump.h:621
TableInfo * pubtable
Definition: pg_dump.h:639
PublicationInfo * publication
Definition: pg_dump.h:638
DumpableObject dobj
Definition: pg_dump.h:637
NamespaceInfo * pubschema
Definition: pg_dump.h:652
DumpableObject dobj
Definition: pg_dump.h:650
PublicationInfo * publication
Definition: pg_dump.h:651
DumpableObject dobj
Definition: pg_dump.h:690
char * srsublsn
Definition: pg_dump.h:694
SubscriptionInfo * subinfo
Definition: pg_dump.h:691
TableInfo * tblinfo
Definition: pg_dump.h:692
char srsubstate
Definition: pg_dump.h:693
char * suboriginremotelsn
Definition: pg_dump.h:674
char * suborigin
Definition: pg_dump.h:673
char * subbinary
Definition: pg_dump.h:663
const char * rolname
Definition: pg_dump.h:661
char * subrunasowner
Definition: pg_dump.h:668
char * subsynccommit
Definition: pg_dump.h:671
char * subpublications
Definition: pg_dump.h:672
char * subtwophasestate
Definition: pg_dump.h:665
char * subfailover
Definition: pg_dump.h:675
char * subenabled
Definition: pg_dump.h:662
char * substream
Definition: pg_dump.h:664
char * subpasswordrequired
Definition: pg_dump.h:667
char * subslotname
Definition: pg_dump.h:670
char * subdisableonerr
Definition: pg_dump.h:666
char * subconninfo
Definition: pg_dump.h:669
DumpableObject dobj
Definition: pg_dump.h:660
char * amhandler
Definition: pg_dump.h:254
DumpableObject dobj
Definition: pg_dump.h:252
FuncInfo aggfn
Definition: pg_dump.h:238
DumpableObject dobj
Definition: pg_dump.h:376
char * adef_expr
Definition: pg_dump.h:379
TableInfo * adtable
Definition: pg_dump.h:377
bool separate
Definition: pg_dump.h:380
char castmethod
Definition: pg_dump.h:501
Oid casttarget
Definition: pg_dump.h:498
char castcontext
Definition: pg_dump.h:500
DumpableObject dobj
Definition: pg_dump.h:496
Oid castsource
Definition: pg_dump.h:497
Oid castfunc
Definition: pg_dump.h:499
Oid cfgparser
Definition: pg_dump.h:549
DumpableObject dobj
Definition: pg_dump.h:547
const char * rolname
Definition: pg_dump.h:548
const char * rolname
Definition: pg_dump.h:272
DumpableObject dobj
Definition: pg_dump.h:271
TypeInfo * condomain
Definition: pg_dump.h:471
TableInfo * contable
Definition: pg_dump.h:470
bool condeferred
Definition: pg_dump.h:477
bool conperiod
Definition: pg_dump.h:478
bool conislocal
Definition: pg_dump.h:479
DumpableObject dobj
Definition: pg_dump.h:469
DumpId conindex
Definition: pg_dump.h:475
bool condeferrable
Definition: pg_dump.h:476
char * condef
Definition: pg_dump.h:473
DumpableObject dobj
Definition: pg_dump.h:277
const char * rolname
Definition: pg_dump.h:278
DumpableObject dobj
Definition: pg_dump.h:575
DumpableAcl dacl
Definition: pg_dump.h:576
const char * defaclrole
Definition: pg_dump.h:577
char defaclobjtype
Definition: pg_dump.h:578
char * dictinitoption
Definition: pg_dump.h:535
DumpableObject dobj
Definition: pg_dump.h:532
const char * rolname
Definition: pg_dump.h:533
Oid dicttemplate
Definition: pg_dump.h:534
char privtype
Definition: pg_dump.h:159
char * acldefault
Definition: pg_dump.h:157
char * acl
Definition: pg_dump.h:156
char * initprivs
Definition: pg_dump.h:160
DumpableAcl dacl
Definition: pg_dump.h:167
DumpableObject dobj
Definition: pg_dump.h:166
DumpComponents dump
Definition: pg_dump.h:139
char * name
Definition: pg_dump.h:138
DumpId * dependencies
Definition: pg_dump.h:145
DumpId dumpId
Definition: pg_dump.h:137
bool ext_member
Definition: pg_dump.h:143
DumpComponents components
Definition: pg_dump.h:142
DumpableObjectType objType
Definition: pg_dump.h:135
CatalogId catId
Definition: pg_dump.h:136
DumpComponents dump_contains
Definition: pg_dump.h:141
bool depends_on_ext
Definition: pg_dump.h:144
char * evtevent
Definition: pg_dump.h:452
char * evtfname
Definition: pg_dump.h:455
char evtenabled
Definition: pg_dump.h:456
char * evtname
Definition: pg_dump.h:451
const char * evtowner
Definition: pg_dump.h:453
char * evttags
Definition: pg_dump.h:454
DumpableObject dobj
Definition: pg_dump.h:450
bool relocatable
Definition: pg_dump.h:182
char * extversion
Definition: pg_dump.h:184
DumpableObject dobj
Definition: pg_dump.h:181
char * extcondition
Definition: pg_dump.h:186
char * extconfig
Definition: pg_dump.h:185
char * fdwhandler
Definition: pg_dump.h:557
const char * rolname
Definition: pg_dump.h:556
char * fdwvalidator
Definition: pg_dump.h:558
char * fdwoptions
Definition: pg_dump.h:559
DumpableAcl dacl
Definition: pg_dump.h:555
DumpableObject dobj
Definition: pg_dump.h:554
DumpableAcl dacl
Definition: pg_dump.h:565
char * srvoptions
Definition: pg_dump.h:570
DumpableObject dobj
Definition: pg_dump.h:564
const char * rolname
Definition: pg_dump.h:566
char * srvversion
Definition: pg_dump.h:569
bool postponed_def
Definition: pg_dump.h:232
Oid lang
Definition: pg_dump.h:228
const char * rolname
Definition: pg_dump.h:227
Oid * argtypes
Definition: pg_dump.h:230
Oid prorettype
Definition: pg_dump.h:231
DumpableObject dobj
Definition: pg_dump.h:225
int nargs
Definition: pg_dump.h:229
DumpableAcl dacl
Definition: pg_dump.h:226
IndxInfo * partitionIdx
Definition: pg_dump.h:417
DumpableObject dobj
Definition: pg_dump.h:415
IndxInfo * parentIdx
Definition: pg_dump.h:416
bool indisreplident
Definition: pg_dump.h:404
int indnkeyattrs
Definition: pg_dump.h:399
char * indstatvals
Definition: pg_dump.h:398
char * indstatcols
Definition: pg_dump.h:397
int indnattrs
Definition: pg_dump.h:400
TableInfo * indextable
Definition: pg_dump.h:393
Oid parentidx
Definition: pg_dump.h:406
Oid * indkeys
Definition: pg_dump.h:401
char * indreloptions
Definition: pg_dump.h:396
DumpId indexconstraint
Definition: pg_dump.h:410
bool indisclustered
Definition: pg_dump.h:403
SimplePtrList partattaches
Definition: pg_dump.h:407
char * tablespace
Definition: pg_dump.h:395
bool indnullsnotdistinct
Definition: pg_dump.h:405
char * indexdef
Definition: pg_dump.h:394
DumpableObject dobj
Definition: pg_dump.h:392
Oid inhparent
Definition: pg_dump.h:517
Oid inhrelid
Definition: pg_dump.h:516
const char * rolname
Definition: pg_dump.h:593
DumpableObject dobj
Definition: pg_dump.h:591
DumpableAcl dacl
Definition: pg_dump.h:592
Oid looids[FLEXIBLE_ARRAY_MEMBER]
Definition: pg_dump.h:595
int numlos
Definition: pg_dump.h:594
DumpableObject dobj
Definition: pg_dump.h:172
DumpableAcl dacl
Definition: pg_dump.h:173
const char * rolname
Definition: pg_dump.h:176
DumpableObject dobj
Definition: pg_dump.h:259
const char * rolname
Definition: pg_dump.h:260
const char * rolname
Definition: pg_dump.h:266
DumpableObject dobj
Definition: pg_dump.h:265
DumpableObject dobj
Definition: pg_dump.h:244
char oprkind
Definition: pg_dump.h:246
Oid oprcode
Definition: pg_dump.h:247
const char * rolname
Definition: pg_dump.h:245
TableInfo * poltable
Definition: pg_dump.h:607
char * polqual
Definition: pg_dump.h:612
char polcmd
Definition: pg_dump.h:609
char * polroles
Definition: pg_dump.h:611
char * polwithcheck
Definition: pg_dump.h:613
DumpableObject dobj
Definition: pg_dump.h:606
bool polpermissive
Definition: pg_dump.h:610
char * polname
Definition: pg_dump.h:608
Oid lanvalidator
Definition: pg_dump.h:490
DumpableAcl dacl
Definition: pg_dump.h:486
DumpableObject dobj
Definition: pg_dump.h:485
Oid laninline
Definition: pg_dump.h:489
const char * lanowner
Definition: pg_dump.h:491
Oid lanplcallfoid
Definition: pg_dump.h:488
bool lanpltrusted
Definition: pg_dump.h:487
DumpableObject dobj
Definition: pg_dump.h:522
Oid prstoken
Definition: pg_dump.h:524
Oid prslextype
Definition: pg_dump.h:527
Oid prsheadline
Definition: pg_dump.h:526
Oid prsstart
Definition: pg_dump.h:523
Oid prsend
Definition: pg_dump.h:525
DumpableObject dobj
Definition: pg_dump.h:430
bool separate
Definition: pg_dump.h:435
char ev_enabled
Definition: pg_dump.h:434
bool is_instead
Definition: pg_dump.h:433
TableInfo * ruletable
Definition: pg_dump.h:431
char ev_type
Definition: pg_dump.h:432
TypeInfo * baseType
Definition: pg_dump.h:220
DumpableObject dobj
Definition: pg_dump.h:218
TableInfo * stattable
Definition: pg_dump.h:424
int stattarget
Definition: pg_dump.h:425
const char * rolname
Definition: pg_dump.h:423
DumpableObject dobj
Definition: pg_dump.h:422
TableInfo * partitionTbl
Definition: pg_dump.h:371
DumpableObject dobj
Definition: pg_dump.h:369
TableInfo * parentTbl
Definition: pg_dump.h:370
TableInfo * tdtable
Definition: pg_dump.h:386
DumpableObject dobj
Definition: pg_dump.h:385
char * filtercond
Definition: pg_dump.h:387
char * attidentity
Definition: pg_dump.h:340
char * reltablespace
Definition: pg_dump.h:293
int ncheck
Definition: pg_dump.h:309
bool ispartition
Definition: pg_dump.h:323
struct _indxInfo * indexes
Definition: pg_dump.h:361
bool * attislocal
Definition: pg_dump.h:344
DumpableObject dobj
Definition: pg_dump.h:286
bool is_identity_sequence
Definition: pg_dump.h:316
Oid reloftype
Definition: pg_dump.h:311
int numParents
Definition: pg_dump.h:326
bool interesting
Definition: pg_dump.h:320
char * toast_reloptions
Definition: pg_dump.h:296
struct _tableInfo ** parents
Definition: pg_dump.h:327
DumpableAcl dacl
Definition: pg_dump.h:287
bool relispopulated
Definition: pg_dump.h:291
char * attgenerated
Definition: pg_dump.h:341
int * attlen
Definition: pg_dump.h:342
Oid reltype
Definition: pg_dump.h:310
char ** attfdwoptions
Definition: pg_dump.h:348
bool hasoids
Definition: pg_dump.h:303
Oid toast_oid
Definition: pg_dump.h:306
Oid foreign_server
Definition: pg_dump.h:312
bool hasrules
Definition: pg_dump.h:298
struct _triggerInfo * triggers
Definition: pg_dump.h:364
bool * attisdropped
Definition: pg_dump.h:339
bool needs_override
Definition: pg_dump.h:354
struct _constraintInfo * checkexprs
Definition: pg_dump.h:353
int * attstattarget
Definition: pg_dump.h:336
uint32 frozenxid
Definition: pg_dump.h:304
char * typstorage
Definition: pg_dump.h:338
int owning_col
Definition: pg_dump.h:315
char * checkoption
Definition: pg_dump.h:295
int numatts
Definition: pg_dump.h:333
bool hastriggers
Definition: pg_dump.h:299
const char * rolname
Definition: pg_dump.h:288
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:352
char ** attoptions
Definition: pg_dump.h:345
char relreplident
Definition: pg_dump.h:292
int numTriggers
Definition: pg_dump.h:363
uint32 minmxid
Definition: pg_dump.h:305
Oid * attcollation
Definition: pg_dump.h:346
char * attstorage
Definition: pg_dump.h:337
int toastpages
Definition: pg_dump.h:318
bool * notnull
Definition: pg_dump.h:350
Oid owning_tab
Definition: pg_dump.h:314
struct _tableDataInfo * dataObj
Definition: pg_dump.h:362
char * amname
Definition: pg_dump.h:355
bool dummy_view
Definition: pg_dump.h:321
bool forcerowsec
Definition: pg_dump.h:302
bool hascolumnACLs
Definition: pg_dump.h:300
char ** atttypnames
Definition: pg_dump.h:335
char ** attmissingval
Definition: pg_dump.h:349
char relpersistence
Definition: pg_dump.h:290
char ** attnames
Definition: pg_dump.h:334
char relkind
Definition: pg_dump.h:289
bool hasindex
Definition: pg_dump.h:297
bool unsafe_partitions
Definition: pg_dump.h:324
char * reloptions
Definition: pg_dump.h:294
int numIndexes
Definition: pg_dump.h:360
int relpages
Definition: pg_dump.h:317
uint32 toast_frozenxid
Definition: pg_dump.h:307
uint32 toast_minmxid
Definition: pg_dump.h:308
char * attalign
Definition: pg_dump.h:343
char * attcompression
Definition: pg_dump.h:347
bool postponed_def
Definition: pg_dump.h:322
bool rowsec
Definition: pg_dump.h:301
bool * inhNotNull
Definition: pg_dump.h:351
Oid tmpllexize
Definition: pg_dump.h:542
Oid tmplinit
Definition: pg_dump.h:541
DumpableObject dobj
Definition: pg_dump.h:540
DumpableObject dobj
Definition: pg_dump.h:506
Oid trffromsql
Definition: pg_dump.h:509
TableInfo * tgtable
Definition: pg_dump.h:442
DumpableObject dobj
Definition: pg_dump.h:441
char tgenabled
Definition: pg_dump.h:443
char * tgdef
Definition: pg_dump.h:445
bool tgispartition
Definition: pg_dump.h:444
bool isMultirange
Definition: pg_dump.h:207
struct _constraintInfo * domChecks
Definition: pg_dump.h:213
DumpableAcl dacl
Definition: pg_dump.h:192
DumpableObject dobj
Definition: pg_dump.h:191
bool isDefined
Definition: pg_dump.h:208
char * ftypname
Definition: pg_dump.h:199
char typrelkind
Definition: pg_dump.h:204
Oid typarray
Definition: pg_dump.h:203
Oid typelem
Definition: pg_dump.h:201
struct _shellTypeInfo * shellType
Definition: pg_dump.h:210
int nDomChecks
Definition: pg_dump.h:212
char typtype
Definition: pg_dump.h:205
const char * rolname
Definition: pg_dump.h:200
Oid typrelid
Definition: pg_dump.h:202
bool isArray
Definition: pg_dump.h:206