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;
203  char typrelkind; /* 'r', 'v', 'c', etc */
204  char typtype; /* 'b', 'c', etc */
205  bool isArray; /* true if auto-generated array type */
206  bool isMultirange; /* true if auto-generated multirange type */
207  bool isDefined; /* true if typisdefined */
208  /* If needed, we'll create a "shell type" entry for it; link that here: */
209  struct _shellTypeInfo *shellType; /* shell-type entry, or NULL */
210  /* If it's a domain, we store links to its constraints here: */
214 
215 typedef struct _shellTypeInfo
216 {
218 
219  TypeInfo *baseType; /* back link to associated base type */
221 
222 typedef struct _funcInfo
223 {
226  const char *rolname;
228  int nargs;
231  bool postponed_def; /* function must be postponed into post-data */
233 
234 /* AggInfo is a superset of FuncInfo */
235 typedef struct _aggInfo
236 {
238  /* we don't require any other fields at the moment */
240 
241 typedef struct _oprInfo
242 {
244  const char *rolname;
245  char oprkind;
248 
249 typedef struct _accessMethodInfo
250 {
252  char amtype;
253  char *amhandler;
255 
256 typedef struct _opclassInfo
257 {
259  const char *rolname;
261 
262 typedef struct _opfamilyInfo
263 {
265  const char *rolname;
267 
268 typedef struct _collInfo
269 {
271  const char *rolname;
273 
274 typedef struct _convInfo
275 {
277  const char *rolname;
279 
280 typedef struct _tableInfo
281 {
282  /*
283  * These fields are collected for every table in the database.
284  */
287  const char *rolname;
288  char relkind;
289  char relpersistence; /* relation persistence */
290  bool relispopulated; /* relation is populated */
291  char relreplident; /* replica identifier */
292  char *reltablespace; /* relation tablespace */
293  char *reloptions; /* options specified by WITH (...) */
294  char *checkoption; /* WITH CHECK OPTION, if any */
295  char *toast_reloptions; /* WITH options for the TOAST table */
296  bool hasindex; /* does it have any indexes? */
297  bool hasrules; /* does it have any rules? */
298  bool hastriggers; /* does it have any triggers? */
299  bool hascolumnACLs; /* do any columns have non-default ACLs? */
300  bool rowsec; /* is row security enabled? */
301  bool forcerowsec; /* is row security forced? */
302  bool hasoids; /* does it have OIDs? */
303  uint32 frozenxid; /* table's relfrozenxid */
304  uint32 minmxid; /* table's relminmxid */
305  Oid toast_oid; /* toast table's OID, or 0 if none */
306  uint32 toast_frozenxid; /* toast table's relfrozenxid, if any */
307  uint32 toast_minmxid; /* toast table's relminmxid */
308  int ncheck; /* # of CHECK expressions */
309  Oid reltype; /* OID of table's composite type, if any */
310  Oid reloftype; /* underlying type for typed table */
311  Oid foreign_server; /* foreign server oid, if applicable */
312  /* these two are set only if table is a sequence owned by a column: */
313  Oid owning_tab; /* OID of table owning sequence */
314  int owning_col; /* attr # of column owning sequence */
316  int relpages; /* table's size in pages (from pg_class) */
317  int toastpages; /* toast table's size in pages, if any */
318 
319  bool interesting; /* true if need to collect more data */
320  bool dummy_view; /* view's real definition must be postponed */
321  bool postponed_def; /* matview must be postponed into post-data */
322  bool ispartition; /* is table a partition? */
323  bool unsafe_partitions; /* is it an unsafe partitioned table? */
324 
325  int numParents; /* number of (immediate) parent tables */
326  struct _tableInfo **parents; /* TableInfos of immediate parents */
327 
328  /*
329  * These fields are computed only if we decide the table is interesting
330  * (it's either a table to dump, or a direct parent of a dumpable table).
331  */
332  int numatts; /* number of attributes */
333  char **attnames; /* the attribute names */
334  char **atttypnames; /* attribute type names */
335  int *attstattarget; /* attribute statistics targets */
336  char *attstorage; /* attribute storage scheme */
337  char *typstorage; /* type storage scheme */
338  bool *attisdropped; /* true if attr is dropped; don't dump it */
339  char *attidentity;
341  int *attlen; /* attribute length, used by binary_upgrade */
342  char *attalign; /* attribute align, used by binary_upgrade */
343  bool *attislocal; /* true if attr has local definition */
344  char **attoptions; /* per-attribute options */
345  Oid *attcollation; /* per-attribute collation selection */
346  char *attcompression; /* per-attribute compression method */
347  char **attfdwoptions; /* per-attribute fdw options */
348  char **attmissingval; /* per attribute missing value */
349  bool *notnull; /* not-null constraints on attributes */
350  bool *inhNotNull; /* true if NOT NULL is inherited */
351  struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
352  struct _constraintInfo *checkexprs; /* CHECK constraints */
353  bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
354  char *amname; /* relation access method */
355 
356  /*
357  * Stuff computed only for dumpable tables.
358  */
359  int numIndexes; /* number of indexes */
360  struct _indxInfo *indexes; /* indexes */
361  struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
362  int numTriggers; /* number of triggers for table */
363  struct _triggerInfo *triggers; /* array of TriggerInfo structs */
365 
366 typedef struct _tableAttachInfo
367 {
369  TableInfo *parentTbl; /* link to partitioned table */
370  TableInfo *partitionTbl; /* link to partition */
372 
373 typedef struct _attrDefInfo
374 {
375  DumpableObject dobj; /* note: dobj.name is name of table */
376  TableInfo *adtable; /* link to table of attribute */
377  int adnum;
378  char *adef_expr; /* decompiled DEFAULT expression */
379  bool separate; /* true if must dump as separate item */
381 
382 typedef struct _tableDataInfo
383 {
385  TableInfo *tdtable; /* link to table to dump */
386  char *filtercond; /* WHERE condition to limit rows dumped */
388 
389 typedef struct _indxInfo
390 {
392  TableInfo *indextable; /* link to table the index is for */
393  char *indexdef;
394  char *tablespace; /* tablespace in which index is stored */
395  char *indreloptions; /* options specified by WITH (...) */
396  char *indstatcols; /* column numbers with statistics */
397  char *indstatvals; /* statistic values for columns */
398  int indnkeyattrs; /* number of index key attributes */
399  int indnattrs; /* total number of index attributes */
400  Oid *indkeys; /* In spite of the name 'indkeys' this field
401  * contains both key and nonkey attributes */
405  Oid parentidx; /* if a partition, parent index OID */
406  SimplePtrList partattaches; /* if partitioned, partition attach objects */
407 
408  /* if there is an associated constraint object, its dumpId: */
411 
412 typedef struct _indexAttachInfo
413 {
415  IndxInfo *parentIdx; /* link to index on partitioned table */
416  IndxInfo *partitionIdx; /* link to index on partition */
418 
419 typedef struct _statsExtInfo
420 {
422  const char *rolname; /* owner */
423  TableInfo *stattable; /* link to table the stats are for */
424  int stattarget; /* statistics target */
426 
427 typedef struct _ruleInfo
428 {
430  TableInfo *ruletable; /* link to table the rule is for */
431  char ev_type;
434  bool separate; /* true if must dump as separate item */
435  /* separate is always true for non-ON SELECT rules */
437 
438 typedef struct _triggerInfo
439 {
441  TableInfo *tgtable; /* link to table the trigger is for */
442  char tgenabled;
444  char *tgdef;
446 
447 typedef struct _evttriggerInfo
448 {
450  char *evtname;
451  char *evtevent;
452  const char *evtowner;
453  char *evttags;
454  char *evtfname;
457 
458 /*
459  * struct ConstraintInfo is used for all constraint types. However we
460  * use a different objType for foreign key constraints, to make it easier
461  * to sort them the way we want.
462  *
463  * Note: condeferrable and condeferred are currently only valid for
464  * unique/primary-key constraints. Otherwise that info is in condef.
465  */
466 typedef struct _constraintInfo
467 {
469  TableInfo *contable; /* NULL if domain constraint */
470  TypeInfo *condomain; /* NULL if table constraint */
471  char contype;
472  char *condef; /* definition, if CHECK or FOREIGN KEY */
473  Oid confrelid; /* referenced table, if FOREIGN KEY */
474  DumpId conindex; /* identifies associated index if any */
475  bool condeferrable; /* true if constraint is DEFERRABLE */
476  bool condeferred; /* true if constraint is INITIALLY DEFERRED */
477  bool conislocal; /* true if constraint has local definition */
478  bool separate; /* true if must dump as separate item */
480 
481 typedef struct _procLangInfo
482 {
489  const char *lanowner;
491 
492 typedef struct _castInfo
493 {
501 
502 typedef struct _transformInfo
503 {
510 
511 /* InhInfo isn't a DumpableObject, just temporary state */
512 typedef struct _inhInfo
513 {
514  Oid inhrelid; /* OID of a child table */
515  Oid inhparent; /* OID of its parent */
517 
518 typedef struct _prsInfo
519 {
527 
528 typedef struct _dictInfo
529 {
531  const char *rolname;
535 
536 typedef struct _tmplInfo
537 {
542 
543 typedef struct _cfgInfo
544 {
546  const char *rolname;
549 
550 typedef struct _fdwInfo
551 {
554  const char *rolname;
555  char *fdwhandler;
557  char *fdwoptions;
559 
560 typedef struct _foreignServerInfo
561 {
564  const char *rolname;
566  char *srvtype;
567  char *srvversion;
568  char *srvoptions;
570 
571 typedef struct _defaultACLInfo
572 {
575  const char *defaclrole;
578 
579 /*
580  * LoInfo represents a group of large objects (blobs) that share the same
581  * owner and ACL setting. dobj.components has the DUMP_COMPONENT_COMMENT bit
582  * set if any blob in the group has a comment; similarly for sec labels.
583  * If there are many blobs with the same owner/ACL, we can divide them into
584  * multiple LoInfo groups, which will each spawn a BLOB METADATA and a BLOBS
585  * (data) TOC entry. This allows more parallelism during restore.
586  */
587 typedef struct _loInfo
588 {
591  const char *rolname;
592  int numlos;
595 
596 /*
597  * The PolicyInfo struct is used to represent policies on a table and
598  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
599  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
600  * it's non-NULL then this is a regular policy definition.
601  */
602 typedef struct _policyInfo
603 {
606  char *polname; /* null indicates RLS is enabled on rel */
607  char polcmd;
609  char *polroles;
610  char *polqual;
613 
614 /*
615  * The PublicationInfo struct is used to represent publications.
616  */
617 typedef struct _PublicationInfo
618 {
620  const char *rolname;
622  bool pubinsert;
623  bool pubupdate;
624  bool pubdelete;
628 
629 /*
630  * The PublicationRelInfo struct is used to represent publication table
631  * mapping.
632  */
633 typedef struct _PublicationRelInfo
634 {
638  char *pubrelqual;
639  char *pubrattrs;
641 
642 /*
643  * The PublicationSchemaInfo struct is used to represent publication schema
644  * mapping.
645  */
647 {
652 
653 /*
654  * The SubscriptionInfo struct is used to represent subscription.
655  */
656 typedef struct _SubscriptionInfo
657 {
659  const char *rolname;
660  char *subenabled;
661  char *subbinary;
662  char *substream;
667  char *subconninfo;
668  char *subslotname;
671  char *suborigin;
673  char *subfailover;
675 
676 /*
677  * The SubRelInfo struct is used to represent a subscription relation.
678  *
679  * XXX Currently, the subscription tables are added to the subscription after
680  * enabling the subscription in binary-upgrade mode. As the apply workers will
681  * not be started in binary_upgrade mode the ordering of enable subscription
682  * does not matter. The order of adding the subscription tables to the
683  * subscription and enabling the subscription should be taken care of if this
684  * feature will be supported in a non-binary-upgrade mode in the future.
685  */
686 typedef struct _SubRelInfo
687 {
692  char *srsublsn;
694 
695 /*
696  * common utility functions
697  */
698 
699 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
700 
701 extern void AssignDumpId(DumpableObject *dobj);
702 extern void recordAdditionalCatalogID(CatalogId catId, DumpableObject *dobj);
703 extern DumpId createDumpId(void);
704 extern DumpId getMaxDumpId(void);
707 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
708 
709 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
710 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
711 
712 extern TableInfo *findTableByOid(Oid oid);
713 extern TypeInfo *findTypeByOid(Oid oid);
714 extern FuncInfo *findFuncByOid(Oid oid);
715 extern OprInfo *findOprByOid(Oid oid);
716 extern CollInfo *findCollationByOid(Oid oid);
721 
722 extern void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext);
723 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
724 
725 extern void parseOidArray(const char *str, Oid *array, int arraysize);
726 
727 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
728  DumpId preBoundaryId, DumpId postBoundaryId);
729 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
730 
731 /*
732  * version specific routines
733  */
734 extern void getNamespaces(Archive *fout);
735 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
736 extern void getTypes(Archive *fout);
737 extern void getFuncs(Archive *fout);
738 extern void getAggregates(Archive *fout);
739 extern void getOperators(Archive *fout);
740 extern void getAccessMethods(Archive *fout);
741 extern void getOpclasses(Archive *fout);
742 extern void getOpfamilies(Archive *fout);
743 extern void getCollations(Archive *fout);
744 extern void getConversions(Archive *fout);
745 extern TableInfo *getTables(Archive *fout, int *numTables);
746 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
747 extern InhInfo *getInherits(Archive *fout, int *numInherits);
748 extern void getPartitioningInfo(Archive *fout);
749 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
750 extern void getExtendedStatistics(Archive *fout);
751 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
752 extern void getRules(Archive *fout);
753 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
754 extern void getProcLangs(Archive *fout);
755 extern void getCasts(Archive *fout);
756 extern void getTransforms(Archive *fout);
757 extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
758 extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
759 extern void getTSParsers(Archive *fout);
760 extern void getTSDictionaries(Archive *fout);
761 extern void getTSTemplates(Archive *fout);
762 extern void getTSConfigurations(Archive *fout);
763 extern void getForeignDataWrappers(Archive *fout);
764 extern void getForeignServers(Archive *fout);
765 extern void getDefaultACLs(Archive *fout);
766 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
767  int numExtensions);
768 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
769  int numExtensions);
770 extern void getEventTriggers(Archive *fout);
771 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
772 extern void getPublications(Archive *fout);
773 extern void getPublicationNamespaces(Archive *fout);
774 extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
775  int numTables);
776 extern void getSubscriptions(Archive *fout);
777 extern void getSubscriptionTables(Archive *fout);
778 
779 #endif /* PG_DUMP_H */
unsigned int uint32
Definition: c.h:506
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:398
const char * str
int DumpId
Definition: pg_backup.h:270
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7694
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:4398
struct _opfamilyInfo OpfamilyInfo
void getPartitioningInfo(Archive *fout)
Definition: pg_dump.c:7245
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:9451
struct _aggInfo AggInfo
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3919
struct _castInfo CastInfo
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17891
struct _tableDataInfo TableDataInfo
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition: common.c:937
struct _cfgInfo TSConfigInfo
void getTypes(Archive *fout)
Definition: pg_dump.c:5805
struct _dumpableObject DumpableObject
struct _accessMethodInfo AccessMethodInfo
struct _attrDefInfo AttrDefInfo
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7126
void getOpclasses(Archive *fout)
Definition: pg_dump.c:6222
void getForeignServers(Archive *fout)
Definition: pg_dump.c:9535
void getFuncs(Archive *fout)
Definition: pg_dump.c:6485
SubscriptionInfo * findSubscriptionByOid(Oid oid)
Definition: common.c:991
void getTSDictionaries(Archive *fout)
Definition: pg_dump.c:9267
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:4485
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition: common.c:743
void getCasts(Archive *fout)
Definition: pg_dump.c:8427
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7305
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:783
void getTSConfigurations(Archive *fout)
Definition: pg_dump.c:9392
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:6160
void getConversions(Archive *fout)
Definition: pg_dump.c:6098
void getRules(Archive *fout)
Definition: pg_dump.c:7972
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:7189
void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
Definition: pg_dump.c:8621
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:4939
void getCollations(Archive *fout)
Definition: pg_dump.c:6036
struct _namespaceInfo NamespaceInfo
void getAggregates(Archive *fout)
Definition: pg_dump.c:6344
struct _shellTypeInfo ShellTypeInfo
void getNamespaces(Archive *fout)
Definition: pg_dump.c:5601
void getPublications(Archive *fout)
Definition: pg_dump.c:4204
void getTSParsers(Archive *fout)
Definition: pg_dump.c:9193
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:7615
struct _dumpableAcl DumpableAcl
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17984
DumpId getMaxDumpId(void)
Definition: common.c:719
void getDefaultACLs(Archive *fout)
Definition: pg_dump.c:9623
uint32 DumpComponents
Definition: pg_dump.h:95
struct _typeInfo TypeInfo
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:4739
void sortDumpableObjects(DumpableObject **objs, int numObjs, DumpId preBoundaryId, DumpId postBoundaryId)
Definition: pg_dump_sort.c:322
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:5733
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:8069
void getTransforms(Archive *fout)
Definition: pg_dump.c:8537
void getEventTriggers(Archive *fout)
Definition: pg_dump.c:8265
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:6680
void getTSTemplates(Archive *fout)
Definition: pg_dump.c:9333
void getProcLangs(Archive *fout)
Definition: pg_dump.c:8343
bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno)
Definition: pg_dump.c:9178
struct _tableAttachInfo TableAttachInfo
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:808
void getOperators(Archive *fout)
Definition: pg_dump.c:5968
void getOpfamilies(Archive *fout)
Definition: pg_dump.c:6282
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:620
bool puballtables
Definition: pg_dump.h:621
bool pubtruncate
Definition: pg_dump.h:625
DumpableObject dobj
Definition: pg_dump.h:619
TableInfo * pubtable
Definition: pg_dump.h:637
PublicationInfo * publication
Definition: pg_dump.h:636
DumpableObject dobj
Definition: pg_dump.h:635
NamespaceInfo * pubschema
Definition: pg_dump.h:650
DumpableObject dobj
Definition: pg_dump.h:648
PublicationInfo * publication
Definition: pg_dump.h:649
DumpableObject dobj
Definition: pg_dump.h:688
char * srsublsn
Definition: pg_dump.h:692
SubscriptionInfo * subinfo
Definition: pg_dump.h:689
TableInfo * tblinfo
Definition: pg_dump.h:690
char srsubstate
Definition: pg_dump.h:691
char * suboriginremotelsn
Definition: pg_dump.h:672
char * suborigin
Definition: pg_dump.h:671
char * subbinary
Definition: pg_dump.h:661
const char * rolname
Definition: pg_dump.h:659
char * subrunasowner
Definition: pg_dump.h:666
char * subsynccommit
Definition: pg_dump.h:669
char * subpublications
Definition: pg_dump.h:670
char * subtwophasestate
Definition: pg_dump.h:663
char * subfailover
Definition: pg_dump.h:673
char * subenabled
Definition: pg_dump.h:660
char * substream
Definition: pg_dump.h:662
char * subpasswordrequired
Definition: pg_dump.h:665
char * subslotname
Definition: pg_dump.h:668
char * subdisableonerr
Definition: pg_dump.h:664
char * subconninfo
Definition: pg_dump.h:667
DumpableObject dobj
Definition: pg_dump.h:658
char * amhandler
Definition: pg_dump.h:253
DumpableObject dobj
Definition: pg_dump.h:251
FuncInfo aggfn
Definition: pg_dump.h:237
DumpableObject dobj
Definition: pg_dump.h:375
char * adef_expr
Definition: pg_dump.h:378
TableInfo * adtable
Definition: pg_dump.h:376
bool separate
Definition: pg_dump.h:379
char castmethod
Definition: pg_dump.h:499
Oid casttarget
Definition: pg_dump.h:496
char castcontext
Definition: pg_dump.h:498
DumpableObject dobj
Definition: pg_dump.h:494
Oid castsource
Definition: pg_dump.h:495
Oid castfunc
Definition: pg_dump.h:497
Oid cfgparser
Definition: pg_dump.h:547
DumpableObject dobj
Definition: pg_dump.h:545
const char * rolname
Definition: pg_dump.h:546
const char * rolname
Definition: pg_dump.h:271
DumpableObject dobj
Definition: pg_dump.h:270
TypeInfo * condomain
Definition: pg_dump.h:470
TableInfo * contable
Definition: pg_dump.h:469
bool condeferred
Definition: pg_dump.h:476
bool conislocal
Definition: pg_dump.h:477
DumpableObject dobj
Definition: pg_dump.h:468
DumpId conindex
Definition: pg_dump.h:474
bool condeferrable
Definition: pg_dump.h:475
char * condef
Definition: pg_dump.h:472
DumpableObject dobj
Definition: pg_dump.h:276
const char * rolname
Definition: pg_dump.h:277
DumpableObject dobj
Definition: pg_dump.h:573
DumpableAcl dacl
Definition: pg_dump.h:574
const char * defaclrole
Definition: pg_dump.h:575
char defaclobjtype
Definition: pg_dump.h:576
char * dictinitoption
Definition: pg_dump.h:533
DumpableObject dobj
Definition: pg_dump.h:530
const char * rolname
Definition: pg_dump.h:531
Oid dicttemplate
Definition: pg_dump.h:532
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:451
char * evtfname
Definition: pg_dump.h:454
char evtenabled
Definition: pg_dump.h:455
char * evtname
Definition: pg_dump.h:450
const char * evtowner
Definition: pg_dump.h:452
char * evttags
Definition: pg_dump.h:453
DumpableObject dobj
Definition: pg_dump.h:449
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:555
const char * rolname
Definition: pg_dump.h:554
char * fdwvalidator
Definition: pg_dump.h:556
char * fdwoptions
Definition: pg_dump.h:557
DumpableAcl dacl
Definition: pg_dump.h:553
DumpableObject dobj
Definition: pg_dump.h:552
DumpableAcl dacl
Definition: pg_dump.h:563
char * srvoptions
Definition: pg_dump.h:568
DumpableObject dobj
Definition: pg_dump.h:562
const char * rolname
Definition: pg_dump.h:564
char * srvversion
Definition: pg_dump.h:567
bool postponed_def
Definition: pg_dump.h:231
Oid lang
Definition: pg_dump.h:227
const char * rolname
Definition: pg_dump.h:226
Oid * argtypes
Definition: pg_dump.h:229
Oid prorettype
Definition: pg_dump.h:230
DumpableObject dobj
Definition: pg_dump.h:224
int nargs
Definition: pg_dump.h:228
DumpableAcl dacl
Definition: pg_dump.h:225
IndxInfo * partitionIdx
Definition: pg_dump.h:416
DumpableObject dobj
Definition: pg_dump.h:414
IndxInfo * parentIdx
Definition: pg_dump.h:415
bool indisreplident
Definition: pg_dump.h:403
int indnkeyattrs
Definition: pg_dump.h:398
char * indstatvals
Definition: pg_dump.h:397
char * indstatcols
Definition: pg_dump.h:396
int indnattrs
Definition: pg_dump.h:399
TableInfo * indextable
Definition: pg_dump.h:392
Oid parentidx
Definition: pg_dump.h:405
Oid * indkeys
Definition: pg_dump.h:400
char * indreloptions
Definition: pg_dump.h:395
DumpId indexconstraint
Definition: pg_dump.h:409
bool indisclustered
Definition: pg_dump.h:402
SimplePtrList partattaches
Definition: pg_dump.h:406
char * tablespace
Definition: pg_dump.h:394
bool indnullsnotdistinct
Definition: pg_dump.h:404
char * indexdef
Definition: pg_dump.h:393
DumpableObject dobj
Definition: pg_dump.h:391
Oid inhparent
Definition: pg_dump.h:515
Oid inhrelid
Definition: pg_dump.h:514
const char * rolname
Definition: pg_dump.h:591
DumpableObject dobj
Definition: pg_dump.h:589
DumpableAcl dacl
Definition: pg_dump.h:590
Oid looids[FLEXIBLE_ARRAY_MEMBER]
Definition: pg_dump.h:593
int numlos
Definition: pg_dump.h:592
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:258
const char * rolname
Definition: pg_dump.h:259
const char * rolname
Definition: pg_dump.h:265
DumpableObject dobj
Definition: pg_dump.h:264
DumpableObject dobj
Definition: pg_dump.h:243
char oprkind
Definition: pg_dump.h:245
Oid oprcode
Definition: pg_dump.h:246
const char * rolname
Definition: pg_dump.h:244
TableInfo * poltable
Definition: pg_dump.h:605
char * polqual
Definition: pg_dump.h:610
char polcmd
Definition: pg_dump.h:607
char * polroles
Definition: pg_dump.h:609
char * polwithcheck
Definition: pg_dump.h:611
DumpableObject dobj
Definition: pg_dump.h:604
bool polpermissive
Definition: pg_dump.h:608
char * polname
Definition: pg_dump.h:606
Oid lanvalidator
Definition: pg_dump.h:488
DumpableAcl dacl
Definition: pg_dump.h:484
DumpableObject dobj
Definition: pg_dump.h:483
Oid laninline
Definition: pg_dump.h:487
const char * lanowner
Definition: pg_dump.h:489
Oid lanplcallfoid
Definition: pg_dump.h:486
bool lanpltrusted
Definition: pg_dump.h:485
DumpableObject dobj
Definition: pg_dump.h:520
Oid prstoken
Definition: pg_dump.h:522
Oid prslextype
Definition: pg_dump.h:525
Oid prsheadline
Definition: pg_dump.h:524
Oid prsstart
Definition: pg_dump.h:521
Oid prsend
Definition: pg_dump.h:523
DumpableObject dobj
Definition: pg_dump.h:429
bool separate
Definition: pg_dump.h:434
char ev_enabled
Definition: pg_dump.h:433
bool is_instead
Definition: pg_dump.h:432
TableInfo * ruletable
Definition: pg_dump.h:430
char ev_type
Definition: pg_dump.h:431
TypeInfo * baseType
Definition: pg_dump.h:219
DumpableObject dobj
Definition: pg_dump.h:217
TableInfo * stattable
Definition: pg_dump.h:423
int stattarget
Definition: pg_dump.h:424
const char * rolname
Definition: pg_dump.h:422
DumpableObject dobj
Definition: pg_dump.h:421
TableInfo * partitionTbl
Definition: pg_dump.h:370
DumpableObject dobj
Definition: pg_dump.h:368
TableInfo * parentTbl
Definition: pg_dump.h:369
TableInfo * tdtable
Definition: pg_dump.h:385
DumpableObject dobj
Definition: pg_dump.h:384
char * filtercond
Definition: pg_dump.h:386
char * attidentity
Definition: pg_dump.h:339
char * reltablespace
Definition: pg_dump.h:292
int ncheck
Definition: pg_dump.h:308
bool ispartition
Definition: pg_dump.h:322
struct _indxInfo * indexes
Definition: pg_dump.h:360
bool * attislocal
Definition: pg_dump.h:343
DumpableObject dobj
Definition: pg_dump.h:285
bool is_identity_sequence
Definition: pg_dump.h:315
Oid reloftype
Definition: pg_dump.h:310
int numParents
Definition: pg_dump.h:325
bool interesting
Definition: pg_dump.h:319
char * toast_reloptions
Definition: pg_dump.h:295
struct _tableInfo ** parents
Definition: pg_dump.h:326
DumpableAcl dacl
Definition: pg_dump.h:286
bool relispopulated
Definition: pg_dump.h:290
char * attgenerated
Definition: pg_dump.h:340
int * attlen
Definition: pg_dump.h:341
Oid reltype
Definition: pg_dump.h:309
char ** attfdwoptions
Definition: pg_dump.h:347
bool hasoids
Definition: pg_dump.h:302
Oid toast_oid
Definition: pg_dump.h:305
Oid foreign_server
Definition: pg_dump.h:311
bool hasrules
Definition: pg_dump.h:297
struct _triggerInfo * triggers
Definition: pg_dump.h:363
bool * attisdropped
Definition: pg_dump.h:338
bool needs_override
Definition: pg_dump.h:353
struct _constraintInfo * checkexprs
Definition: pg_dump.h:352
int * attstattarget
Definition: pg_dump.h:335
uint32 frozenxid
Definition: pg_dump.h:303
char * typstorage
Definition: pg_dump.h:337
int owning_col
Definition: pg_dump.h:314
char * checkoption
Definition: pg_dump.h:294
int numatts
Definition: pg_dump.h:332
bool hastriggers
Definition: pg_dump.h:298
const char * rolname
Definition: pg_dump.h:287
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:351
char ** attoptions
Definition: pg_dump.h:344
char relreplident
Definition: pg_dump.h:291
int numTriggers
Definition: pg_dump.h:362
uint32 minmxid
Definition: pg_dump.h:304
Oid * attcollation
Definition: pg_dump.h:345
char * attstorage
Definition: pg_dump.h:336
int toastpages
Definition: pg_dump.h:317
bool * notnull
Definition: pg_dump.h:349
Oid owning_tab
Definition: pg_dump.h:313
struct _tableDataInfo * dataObj
Definition: pg_dump.h:361
char * amname
Definition: pg_dump.h:354
bool dummy_view
Definition: pg_dump.h:320
bool forcerowsec
Definition: pg_dump.h:301
bool hascolumnACLs
Definition: pg_dump.h:299
char ** atttypnames
Definition: pg_dump.h:334
char ** attmissingval
Definition: pg_dump.h:348
char relpersistence
Definition: pg_dump.h:289
char ** attnames
Definition: pg_dump.h:333
char relkind
Definition: pg_dump.h:288
bool hasindex
Definition: pg_dump.h:296
bool unsafe_partitions
Definition: pg_dump.h:323
char * reloptions
Definition: pg_dump.h:293
int numIndexes
Definition: pg_dump.h:359
int relpages
Definition: pg_dump.h:316
uint32 toast_frozenxid
Definition: pg_dump.h:306
uint32 toast_minmxid
Definition: pg_dump.h:307
char * attalign
Definition: pg_dump.h:342
char * attcompression
Definition: pg_dump.h:346
bool postponed_def
Definition: pg_dump.h:321
bool rowsec
Definition: pg_dump.h:300
bool * inhNotNull
Definition: pg_dump.h:350
Oid tmpllexize
Definition: pg_dump.h:540
Oid tmplinit
Definition: pg_dump.h:539
DumpableObject dobj
Definition: pg_dump.h:538
DumpableObject dobj
Definition: pg_dump.h:504
Oid trffromsql
Definition: pg_dump.h:507
TableInfo * tgtable
Definition: pg_dump.h:441
DumpableObject dobj
Definition: pg_dump.h:440
char tgenabled
Definition: pg_dump.h:442
char * tgdef
Definition: pg_dump.h:444
bool tgispartition
Definition: pg_dump.h:443
bool isMultirange
Definition: pg_dump.h:206
struct _constraintInfo * domChecks
Definition: pg_dump.h:212
DumpableAcl dacl
Definition: pg_dump.h:192
DumpableObject dobj
Definition: pg_dump.h:191
bool isDefined
Definition: pg_dump.h:207
char * ftypname
Definition: pg_dump.h:199
char typrelkind
Definition: pg_dump.h:203
Oid typelem
Definition: pg_dump.h:201
struct _shellTypeInfo * shellType
Definition: pg_dump.h:209
int nDomChecks
Definition: pg_dump.h:211
char typtype
Definition: pg_dump.h:204
const char * rolname
Definition: pg_dump.h:200
Oid typrelid
Definition: pg_dump.h:202
bool isArray
Definition: pg_dump.h:205