PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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#include "catalog/pg_publication_d.h"
19
20
21#define oidcmp(x,y) ( ((x) < (y) ? -1 : ((x) > (y)) ? 1 : 0) )
22
23/*
24 * The data structures used to store system catalog information. Every
25 * dumpable object is a subclass of DumpableObject.
26 *
27 * NOTE: the structures described here live for the entire pg_dump run;
28 * and in most cases we make a struct for every object we can find in the
29 * catalogs, not only those we are actually going to dump. Hence, it's
30 * best to store a minimal amount of per-object info in these structs,
31 * and retrieve additional per-object info when and if we dump a specific
32 * object. In particular, try to avoid retrieving expensive-to-compute
33 * information until it's known to be needed. We do, however, have to
34 * store enough info to determine whether an object should be dumped and
35 * what order to dump in.
36 */
37
90
91#define NUM_DUMPABLE_OBJECT_TYPES (DO_SUBSCRIPTION_REL + 1)
92
93/*
94 * DumpComponents is a bitmask of the potentially dumpable components of
95 * a database object: its core definition, plus optional attributes such
96 * as ACL, comments, etc.
97 *
98 * The NONE and ALL symbols are convenient shorthands for assigning values,
99 * but be careful about using them in tests. For example, a test like
100 * "if (dobj->dump == DUMP_COMPONENT_NONE)" is probably wrong; you likely want
101 * "if (!(dobj->dump & DUMP_COMPONENT_DEFINITION))" instead. This is because
102 * we aren't too careful about the values of irrelevant bits, as indeed can be
103 * seen in the definition of DUMP_COMPONENT_ALL. It's also possible that an
104 * object has only subsidiary bits such as DUMP_COMPONENT_ACL set, leading to
105 * unexpected behavior of a test against NONE.
106 */
108#define DUMP_COMPONENT_NONE (0)
109#define DUMP_COMPONENT_DEFINITION (1 << 0)
110#define DUMP_COMPONENT_DATA (1 << 1)
111#define DUMP_COMPONENT_COMMENT (1 << 2)
112#define DUMP_COMPONENT_SECLABEL (1 << 3)
113#define DUMP_COMPONENT_ACL (1 << 4)
114#define DUMP_COMPONENT_POLICY (1 << 5)
115#define DUMP_COMPONENT_USERMAP (1 << 6)
116#define DUMP_COMPONENT_STATISTICS (1 << 7)
117#define DUMP_COMPONENT_ALL (0xFFFF)
118
119/*
120 * component types which require us to obtain a lock on the table
121 *
122 * Note that some components only require looking at the information
123 * in the pg_catalog tables and, for those components, we do not need
124 * to lock the table. Be careful here though- some components use
125 * server-side functions which pull the latest information from
126 * SysCache and in those cases we *do* need to lock the table.
127 *
128 * We do not need locks for the COMMENT and SECLABEL components as
129 * those simply query their associated tables without using any
130 * server-side functions. We do not need locks for the ACL component
131 * as we pull that information from pg_class without using any
132 * server-side functions that use SysCache. The USERMAP component
133 * is only relevant for FOREIGN SERVERs and not tables, so no sense
134 * locking a table for that either (that can happen if we are going
135 * to dump "ALL" components for a table).
136 *
137 * We DO need locks for DEFINITION, due to various server-side
138 * functions that are used and POLICY due to pg_get_expr(). We set
139 * this up to grab the lock except in the cases we know to be safe.
140 */
141#define DUMP_COMPONENTS_REQUIRING_LOCK (\
142 DUMP_COMPONENT_DEFINITION |\
143 DUMP_COMPONENT_DATA |\
144 DUMP_COMPONENT_STATISTICS |\
145 DUMP_COMPONENT_POLICY)
146
147typedef struct _dumpableObject
148{
150 CatalogId catId; /* zero if not a cataloged object */
151 DumpId dumpId; /* assigned by AssignDumpId() */
152 char *name; /* object name (should never be NULL) */
153 struct _namespaceInfo *namespace; /* containing namespace, or NULL */
154 DumpComponents dump; /* bitmask of components requested to dump */
155 DumpComponents dump_contains; /* as above, but for contained objects */
156 DumpComponents components; /* bitmask of components available to dump */
157 bool ext_member; /* true if object is member of extension */
158 bool depends_on_ext; /* true if object depends on an extension */
159 DumpId *dependencies; /* dumpIds of objects this one depends on */
160 int nDeps; /* number of valid dependencies */
161 int allocDeps; /* allocated size of dependencies[] */
163
164/*
165 * Object types that have ACLs must store them in a DumpableAcl sub-struct,
166 * which must immediately follow the DumpableObject base struct.
167 */
168typedef struct _dumpableAcl
169{
170 char *acl; /* the object's actual ACL string */
171 char *acldefault; /* default ACL for the object's type & owner */
172 /* these fields come from the object's pg_init_privs entry, if any: */
173 char privtype; /* entry type, 'i' or 'e'; 0 if no entry */
174 char *initprivs; /* the object's initial ACL string, or NULL */
176
177/* Generic struct that can be used to access any object type having an ACL */
183
184typedef struct _namespaceInfo
185{
188 bool create; /* CREATE SCHEMA, or just set owner? */
189 Oid nspowner; /* OID of owner */
190 const char *rolname; /* name of owner */
192
193typedef struct _extensionInfo
194{
196 char *namespace; /* schema containing extension's objects */
199 char *extconfig; /* info about configuration tables */
202
203typedef struct _typeInfo
204{
207
208 /*
209 * Note: dobj.name is the raw pg_type.typname entry. ftypname is the
210 * result of format_type(), which will be quoted if needed, and might be
211 * schema-qualified too.
212 */
213 char *ftypname;
214 const char *rolname;
218 char typrelkind; /* 'r', 'v', 'c', etc */
219 char typtype; /* 'b', 'c', etc */
220 bool isArray; /* true if auto-generated array type */
221 bool isMultirange; /* true if auto-generated multirange type */
222 bool isDefined; /* true if typisdefined */
223 /* If needed, we'll create a "shell type" entry for it; link that here: */
224 struct _shellTypeInfo *shellType; /* shell-type entry, or NULL */
225 /* If it's a domain, its not-null constraint is here: */
227 /* If it's a domain, we store links to its CHECK constraints here: */
231
232typedef struct _shellTypeInfo
233{
235
236 TypeInfo *baseType; /* back link to associated base type */
238
239typedef struct _funcInfo
240{
243 const char *rolname;
245 int nargs;
248 bool postponed_def; /* function must be postponed into post-data */
250
251/* AggInfo is a superset of FuncInfo */
252typedef struct _aggInfo
253{
255 /* we don't require any other fields at the moment */
257
267
274
281
288
295
296typedef struct _convInfo
297{
299 const char *rolname;
301
302typedef struct _tableInfo
303{
304 /*
305 * These fields are collected for every table in the database.
306 */
309 const char *rolname;
311 char relpersistence; /* relation persistence */
312 bool relispopulated; /* relation is populated */
313 char relreplident; /* replica identifier */
314 char *reltablespace; /* relation tablespace */
315 char *reloptions; /* options specified by WITH (...) */
316 char *checkoption; /* WITH CHECK OPTION, if any */
317 char *toast_reloptions; /* WITH options for the TOAST table */
318 bool hasindex; /* does it have any indexes? */
319 bool hasrules; /* does it have any rules? */
320 bool hastriggers; /* does it have any triggers? */
321 bool hascolumnACLs; /* do any columns have non-default ACLs? */
322 bool rowsec; /* is row security enabled? */
323 bool forcerowsec; /* is row security forced? */
324 bool hasoids; /* does it have OIDs? */
325 uint32 frozenxid; /* table's relfrozenxid */
326 uint32 minmxid; /* table's relminmxid */
327 Oid toast_oid; /* toast table's OID, or 0 if none */
328 uint32 toast_frozenxid; /* toast table's relfrozenxid, if any */
329 uint32 toast_minmxid; /* toast table's relminmxid */
330 int ncheck; /* # of CHECK expressions */
331 Oid reltype; /* OID of table's composite type, if any */
332 Oid reloftype; /* underlying type for typed table */
333 Oid foreign_server; /* foreign server oid, if applicable */
334 /* these two are set only if table is a sequence owned by a column: */
335 Oid owning_tab; /* OID of table owning sequence */
336 int owning_col; /* attr # of column owning sequence */
338 int32 relpages; /* table's size in pages (from pg_class) */
339 int toastpages; /* toast table's size in pages, if any */
340
341 bool interesting; /* true if need to collect more data */
342 bool dummy_view; /* view's real definition must be postponed */
343 bool postponed_def; /* matview must be postponed into post-data */
344 bool ispartition; /* is table a partition? */
345 bool unsafe_partitions; /* is it an unsafe partitioned table? */
346
347 int numParents; /* number of (immediate) parent tables */
348 struct _tableInfo **parents; /* TableInfos of immediate parents */
349
350 /*
351 * These fields are computed only if we decide the table is interesting
352 * (it's either a table to dump, or a direct parent of a dumpable table).
353 */
354 int numatts; /* number of attributes */
355 char **attnames; /* the attribute names */
356 char **atttypnames; /* attribute type names */
357 int *attstattarget; /* attribute statistics targets */
358 char *attstorage; /* attribute storage scheme */
359 char *typstorage; /* type storage scheme */
360 bool *attisdropped; /* true if attr is dropped; don't dump it */
363 int *attlen; /* attribute length, used by binary_upgrade */
364 char *attalign; /* attribute align, used by binary_upgrade */
365 bool *attislocal; /* true if attr has local definition */
366 char **attoptions; /* per-attribute options */
367 Oid *attcollation; /* per-attribute collation selection */
368 char *attcompression; /* per-attribute compression method */
369 char **attfdwoptions; /* per-attribute fdw options */
370 char **attmissingval; /* per attribute missing value */
371 char **notnull_constrs; /* NOT NULL constraint names. If null,
372 * there isn't one on this column. If
373 * empty string, unnamed constraint
374 * (pre-v17) */
375 char **notnull_comment; /* comment thereof */
376 bool *notnull_invalid; /* true for NOT NULL NOT VALID */
377 bool *notnull_noinh; /* NOT NULL is NO INHERIT */
378 bool *notnull_islocal; /* true if NOT NULL has local definition */
379 struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
380 struct _constraintInfo *checkexprs; /* CHECK constraints */
381 struct _relStatsInfo *stats; /* only set for matviews */
382 bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
383 char *amname; /* relation access method */
384
385 /*
386 * Stuff computed only for dumpable tables.
387 */
388 int numIndexes; /* number of indexes */
389 struct _indxInfo *indexes; /* indexes */
390 struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
391 int numTriggers; /* number of triggers for table */
392 struct _triggerInfo *triggers; /* array of TriggerInfo structs */
394
395typedef struct _tableAttachInfo
396{
398 TableInfo *parentTbl; /* link to partitioned table */
399 TableInfo *partitionTbl; /* link to partition */
401
402typedef struct _attrDefInfo
403{
404 DumpableObject dobj; /* note: dobj.name is name of table */
405 TableInfo *adtable; /* link to table of attribute */
406 int adnum;
407 char *adef_expr; /* decompiled DEFAULT expression */
408 bool separate; /* true if must dump as separate item */
410
411typedef struct _tableDataInfo
412{
414 TableInfo *tdtable; /* link to table to dump */
415 char *filtercond; /* WHERE condition to limit rows dumped */
417
418typedef struct _indxInfo
419{
421 TableInfo *indextable; /* link to table the index is for */
422 char *indexdef;
423 char *tablespace; /* tablespace in which index is stored */
424 char *indreloptions; /* options specified by WITH (...) */
425 char *indstatcols; /* column numbers with statistics */
426 char *indstatvals; /* statistic values for columns */
427 int indnkeyattrs; /* number of index key attributes */
428 int indnattrs; /* total number of index attributes */
429 Oid *indkeys; /* In spite of the name 'indkeys' this field
430 * contains both key and nonkey attributes */
434 Oid parentidx; /* if a partition, parent index OID */
435 SimplePtrList partattaches; /* if partitioned, partition attach objects */
436
437 /* if there is an associated constraint object, its dumpId: */
440
441typedef struct _indexAttachInfo
442{
444 IndxInfo *parentIdx; /* link to index on partitioned table */
445 IndxInfo *partitionIdx; /* link to index on partition */
447
448typedef struct _relStatsInfo
449{
456 char relkind; /* 'r', 'm', 'i', etc */
457
458 /*
459 * indAttNames/nindAttNames are populated only if the relation is an index
460 * with at least one expression column; we don't need them otherwise.
461 */
462 char **indAttNames; /* attnames of the index, in order */
463 int32 nindAttNames; /* number of attnames stored (can be 0) */
464 teSection section; /* stats may appear in data or post-data */
466
467typedef struct _statsExtInfo
468{
470 const char *rolname; /* owner */
471 TableInfo *stattable; /* link to table the stats are for */
472 int stattarget; /* statistics target */
474
475typedef struct _ruleInfo
476{
478 TableInfo *ruletable; /* link to table the rule is for */
482 bool separate; /* true if must dump as separate item */
483 /* separate is always true for non-ON SELECT rules */
485
486typedef struct _triggerInfo
487{
489 TableInfo *tgtable; /* link to table the trigger is for */
492 char *tgdef;
494
505
506/*
507 * struct ConstraintInfo is used for all constraint types. However we
508 * use a different objType for foreign key constraints, to make it easier
509 * to sort them the way we want.
510 *
511 * Not-null constraints don't need this, unless they are NOT VALID.
512 *
513 * Note: condeferrable and condeferred are currently only valid for
514 * unique/primary-key constraints. Otherwise that info is in condef.
515 */
516typedef struct _constraintInfo
517{
519 TableInfo *contable; /* NULL if domain constraint */
520 TypeInfo *condomain; /* NULL if table constraint */
522 char *condef; /* definition, if CHECK or FOREIGN KEY */
523 Oid confrelid; /* referenced table, if FOREIGN KEY */
524 DumpId conindex; /* identifies associated index if any */
525 bool condeferrable; /* true if constraint is DEFERRABLE */
526 bool condeferred; /* true if constraint is INITIALLY DEFERRED */
527 bool conperiod; /* true if the constraint is WITHOUT OVERLAPS */
528 bool conislocal; /* true if constraint has local definition */
529 bool separate; /* true if must dump as separate item */
531
542
552
561
562/* InhInfo isn't a DumpableObject, just temporary state */
563typedef struct _inhInfo
564{
565 Oid inhrelid; /* OID of a child table */
566 Oid inhparent; /* OID of its parent */
568
578
586
593
600
611
622
630
631/*
632 * LoInfo represents a group of large objects (blobs) that share the same
633 * owner and ACL setting. dobj.components has the DUMP_COMPONENT_COMMENT bit
634 * set if any blob in the group has a comment; similarly for sec labels.
635 * If there are many blobs with the same owner/ACL, we can divide them into
636 * multiple LoInfo groups, which will each spawn a BLOB METADATA and a BLOBS
637 * (data) TOC entry. This allows more parallelism during restore.
638 */
647
648/*
649 * The PolicyInfo struct is used to represent policies on a table and
650 * to indicate if a table has RLS enabled (ENABLE ROW SECURITY). If
651 * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
652 * it's non-NULL then this is a regular policy definition.
653 */
654typedef struct _policyInfo
655{
658 char *polname; /* null indicates RLS is enabled on rel */
659 char polcmd;
661 char *polroles;
662 char *polqual;
665
666/*
667 * The PublicationInfo struct is used to represent publications.
668 */
683
684/*
685 * The PublicationRelInfo struct is used to represent publication table
686 * mapping.
687 */
696
697/*
698 * The PublicationSchemaInfo struct is used to represent publication schema
699 * mapping.
700 */
707
708/*
709 * The SubscriptionInfo struct is used to represent subscription.
710 */
734
735/*
736 * The SubRelInfo struct is used to represent a subscription relation.
737 *
738 * XXX Currently, the subscription tables are added to the subscription after
739 * enabling the subscription in binary-upgrade mode. As the apply workers will
740 * not be started in binary_upgrade mode the ordering of enable subscription
741 * does not matter. The order of adding the subscription tables to the
742 * subscription and enabling the subscription should be taken care of if this
743 * feature will be supported in a non-binary-upgrade mode in the future.
744 */
753
754/*
755 * common utility functions
756 */
757
759
760extern void AssignDumpId(DumpableObject *dobj);
761extern void recordAdditionalCatalogID(CatalogId catId, DumpableObject *dobj);
762extern DumpId createDumpId(void);
763extern DumpId getMaxDumpId(void);
766extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
767
770
771extern TableInfo *findTableByOid(Oid oid);
772extern TypeInfo *findTypeByOid(Oid oid);
773extern FuncInfo *findFuncByOid(Oid oid);
774extern OprInfo *findOprByOid(Oid oid);
776extern CollInfo *findCollationByOid(Oid oid);
781
782extern void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext);
784
785extern void parseOidArray(const char *str, Oid *array, int arraysize);
786
790
791/*
792 * version specific routines
793 */
794extern void getNamespaces(Archive *fout);
796extern void getTypes(Archive *fout);
797extern void getFuncs(Archive *fout);
798extern void getAggregates(Archive *fout);
799extern void getOperators(Archive *fout);
800extern void getAccessMethods(Archive *fout);
801extern void getOpclasses(Archive *fout);
802extern void getOpfamilies(Archive *fout);
803extern void getCollations(Archive *fout);
804extern void getConversions(Archive *fout);
806extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
808extern void getPartitioningInfo(Archive *fout);
809extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
811extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
812extern void getRules(Archive *fout);
813extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
814extern void getProcLangs(Archive *fout);
815extern void getCasts(Archive *fout);
816extern void getTransforms(Archive *fout);
817extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
818extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
819extern void getTSParsers(Archive *fout);
820extern void getTSDictionaries(Archive *fout);
821extern void getTSTemplates(Archive *fout);
822extern void getTSConfigurations(Archive *fout);
824extern void getForeignServers(Archive *fout);
825extern void getDefaultACLs(Archive *fout);
827 int numExtensions);
829 int numExtensions);
830extern void getEventTriggers(Archive *fout);
831extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
832extern void getPublications(Archive *fout);
834extern void getPublicationTables(Archive *fout, TableInfo tblinfo[],
835 int numTables);
836extern void getSubscriptions(Archive *fout);
838
839#endif /* PG_DUMP_H */
#define FLEXIBLE_ARRAY_MEMBER
Definition c.h:552
int32_t int32
Definition c.h:614
uint32_t uint32
Definition c.h:618
const char * str
int DumpId
Definition pg_backup.h:285
enum _teSection teSection
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:8389
struct _collInfo CollInfo
void recordAdditionalCatalogID(CatalogId catId, DumpableObject *dobj)
Definition common.c:720
struct _transformInfo TransformInfo
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition pg_dump.c:6216
void recordExtensionMembership(CatalogId catId, ExtensionInfo *ext)
Definition common.c:1064
void getPublicationNamespaces(Archive *fout)
Definition pg_dump.c:4804
struct _opfamilyInfo OpfamilyInfo
void getPartitioningInfo(Archive *fout)
Definition pg_dump.c:7878
struct _indxInfo IndxInfo
struct _fdwInfo FdwInfo
struct _triggerInfo TriggerInfo
struct _tmplInfo TSTemplateInfo
struct _tableInfo TableInfo
FuncInfo * findFuncByOid(Oid oid)
Definition common.c:919
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition pg_dump.c:7822
TableInfo * findTableByOid(Oid oid)
Definition common.c:864
void getForeignDataWrappers(Archive *fout)
Definition pg_dump.c:10520
struct _aggInfo AggInfo
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:4226
ExtensionInfo * findExtensionByOid(Oid oid)
Definition common.c:1009
struct _castInfo CastInfo
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition pg_dump.c:20196
CollInfo * findCollationByOid(Oid oid)
Definition common.c:973
struct _tableDataInfo TableDataInfo
struct _cfgInfo TSConfigInfo
SubscriptionInfo * findSubscriptionByOid(Oid oid)
Definition common.c:1045
void getTypes(Archive *fout)
Definition pg_dump.c:6291
struct _dumpableObject DumpableObject
struct _accessMethodInfo AccessMethodInfo
struct _attrDefInfo AttrDefInfo
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:7757
void getOpclasses(Archive *fout)
Definition pg_dump.c:6737
void getForeignServers(Archive *fout)
Definition pg_dump.c:10614
void getFuncs(Archive *fout)
Definition pg_dump.c:7006
OprInfo * findOprByOid(Oid oid)
Definition common.c:937
void getTSDictionaries(Archive *fout)
Definition pg_dump.c:10336
struct _ruleInfo RuleInfo
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:4884
NamespaceInfo * findNamespaceByOid(Oid oid)
Definition common.c:991
struct _relStatsInfo RelStatsInfo
void getCasts(Archive *fout)
Definition pg_dump.c:9138
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:7938
AccessMethodInfo * findAccessMethodByOid(Oid oid)
Definition common.c:955
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition common.c:819
void getTSConfigurations(Archive *fout)
Definition pg_dump.c:10461
DumpableObject * findObjectByDumpId(DumpId dumpId)
Definition common.c:766
struct _foreignServerInfo ForeignServerInfo
void parseOidArray(const char *str, Oid *array, int arraysize)
Definition common.c:1112
struct _inhInfo InhInfo
struct _indexAttachInfo IndexAttachInfo
struct _SubRelInfo SubRelInfo
struct _procLangInfo ProcLangInfo
void getAccessMethods(Archive *fout)
Definition pg_dump.c:6663
void getConversions(Archive *fout)
Definition pg_dump.c:6601
void getRules(Archive *fout)
Definition pg_dump.c:8683
ExtensionInfo * findOwningExtension(CatalogId catalogId)
Definition common.c:1088
void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
Definition pg_dump.c:9332
struct _prsInfo TSParserInfo
struct _policyInfo PolicyInfo
TableInfo * getSchemaData(Archive *fout, int *numTablesPtr)
Definition common.c:98
struct _PublicationInfo PublicationInfo
void getCollations(Archive *fout)
Definition pg_dump.c:6535
struct _namespaceInfo NamespaceInfo
void getAggregates(Archive *fout)
Definition pg_dump.c:6865
struct _shellTypeInfo ShellTypeInfo
void getNamespaces(Archive *fout)
Definition pg_dump.c:6084
void getPublications(Archive *fout)
Definition pg_dump.c:4516
void getTSParsers(Archive *fout)
Definition pg_dump.c:10262
TypeInfo * findTypeByOid(Oid oid)
Definition common.c:900
struct _dumpableObjectWithAcl DumpableObjectWithAcl
struct _defaultACLInfo DefaultACLInfo
DumpId createDumpId(void)
Definition common.c:746
TableInfo * getTables(Archive *fout, int *numTables)
Definition pg_dump.c:7279
struct _loInfo LoInfo
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition common.c:779
void AssignDumpId(DumpableObject *dobj)
Definition common.c:658
struct _evttriggerInfo EventTriggerInfo
void getExtendedStatistics(Archive *fout)
Definition pg_dump.c:8307
struct _dumpableAcl DumpableAcl
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition pg_dump.c:20289
DumpId getMaxDumpId(void)
Definition common.c:755
void getDefaultACLs(Archive *fout)
Definition pg_dump.c:10702
uint32 DumpComponents
Definition pg_dump.h:107
struct _typeInfo TypeInfo
void getSubscriptions(Archive *fout)
Definition pg_dump.c:5159
void sortDumpableObjects(DumpableObject **objs, int numObjs, DumpId preBoundaryId, DumpId postBoundaryId)
struct _SubscriptionInfo SubscriptionInfo
struct _extensionInfo ExtensionInfo
struct _dictInfo TSDictInfo
struct _funcInfo FuncInfo
struct _opclassInfo OpclassInfo
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition common.c:798
struct _statsExtInfo StatsExtInfo
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:8780
void getTransforms(Archive *fout)
Definition pg_dump.c:9248
void getEventTriggers(Archive *fout)
Definition pg_dump.c:8976
DumpableObjectType
Definition pg_dump.h:39
@ DO_EVENT_TRIGGER
Definition pg_dump.h:80
@ DO_REFRESH_MATVIEW
Definition pg_dump.h:81
@ DO_POLICY
Definition pg_dump.h:82
@ DO_CAST
Definition pg_dump.h:64
@ DO_FOREIGN_SERVER
Definition pg_dump.h:73
@ DO_PRE_DATA_BOUNDARY
Definition pg_dump.h:78
@ DO_PROCLANG
Definition pg_dump.h:63
@ DO_TYPE
Definition pg_dump.h:43
@ DO_INDEX
Definition pg_dump.h:56
@ DO_COLLATION
Definition pg_dump.h:51
@ DO_LARGE_OBJECT
Definition pg_dump.h:76
@ DO_TSCONFIG
Definition pg_dump.h:71
@ DO_OPERATOR
Definition pg_dump.h:47
@ DO_FK_CONSTRAINT
Definition pg_dump.h:62
@ DO_CONSTRAINT
Definition pg_dump.h:61
@ DO_SUBSCRIPTION
Definition pg_dump.h:87
@ DO_DEFAULT_ACL
Definition pg_dump.h:74
@ DO_FDW
Definition pg_dump.h:72
@ DO_SUBSCRIPTION_REL
Definition pg_dump.h:88
@ DO_REL_STATS
Definition pg_dump.h:86
@ DO_SEQUENCE_SET
Definition pg_dump.h:66
@ DO_ATTRDEF
Definition pg_dump.h:55
@ DO_PUBLICATION_REL
Definition pg_dump.h:84
@ DO_TABLE_ATTACH
Definition pg_dump.h:54
@ DO_OPCLASS
Definition pg_dump.h:49
@ DO_INDEX_ATTACH
Definition pg_dump.h:57
@ DO_TSTEMPLATE
Definition pg_dump.h:70
@ DO_STATSEXT
Definition pg_dump.h:58
@ DO_FUNC
Definition pg_dump.h:45
@ DO_POST_DATA_BOUNDARY
Definition pg_dump.h:79
@ DO_LARGE_OBJECT_DATA
Definition pg_dump.h:77
@ DO_OPFAMILY
Definition pg_dump.h:50
@ DO_TRANSFORM
Definition pg_dump.h:75
@ DO_ACCESS_METHOD
Definition pg_dump.h:48
@ DO_PUBLICATION_TABLE_IN_SCHEMA
Definition pg_dump.h:85
@ DO_CONVERSION
Definition pg_dump.h:52
@ DO_TRIGGER
Definition pg_dump.h:60
@ DO_RULE
Definition pg_dump.h:59
@ DO_DUMMY_TYPE
Definition pg_dump.h:67
@ DO_TSDICT
Definition pg_dump.h:69
@ DO_TSPARSER
Definition pg_dump.h:68
@ DO_EXTENSION
Definition pg_dump.h:42
@ DO_TABLE_DATA
Definition pg_dump.h:65
@ DO_PUBLICATION
Definition pg_dump.h:83
@ DO_TABLE
Definition pg_dump.h:53
@ DO_NAMESPACE
Definition pg_dump.h:41
@ DO_AGG
Definition pg_dump.h:46
@ DO_SHELL_TYPE
Definition pg_dump.h:44
struct _PublicationRelInfo PublicationRelInfo
PublicationInfo * findPublicationByOid(Oid oid)
Definition common.c:1027
void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs)
struct _convInfo ConvInfo
struct _constraintInfo ConstraintInfo
void getTSTemplates(Archive *fout)
Definition pg_dump.c:10402
void getProcLangs(Archive *fout)
Definition pg_dump.c:9054
bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno)
Definition pg_dump.c:10247
void getSubscriptionRelations(Archive *fout)
Definition pg_dump.c:5409
struct _tableAttachInfo TableAttachInfo
void removeObjectDependency(DumpableObject *dobj, DumpId refId)
Definition common.c:844
void getOperators(Archive *fout)
Definition pg_dump.c:6459
void getOpfamilies(Archive *fout)
Definition pg_dump.c:6800
struct _oprInfo OprInfo
struct _PublicationSchemaInfo PublicationSchemaInfo
static Archive * fout
Definition pg_dumpall.c:139
unsigned int Oid
static int fb(int x)
const char * rolname
Definition pg_dump.h:672
SimplePtrList except_tables
Definition pg_dump.h:681
bool puballsequences
Definition pg_dump.h:674
PublishGencolsType pubgencols_type
Definition pg_dump.h:680
DumpableObject dobj
Definition pg_dump.h:671
TableInfo * pubtable
Definition pg_dump.h:692
PublicationInfo * publication
Definition pg_dump.h:691
DumpableObject dobj
Definition pg_dump.h:690
NamespaceInfo * pubschema
Definition pg_dump.h:705
DumpableObject dobj
Definition pg_dump.h:703
PublicationInfo * publication
Definition pg_dump.h:704
DumpableObject dobj
Definition pg_dump.h:747
char * srsublsn
Definition pg_dump.h:751
SubscriptionInfo * subinfo
Definition pg_dump.h:748
TableInfo * tblinfo
Definition pg_dump.h:749
char srsubstate
Definition pg_dump.h:750
char * suboriginremotelsn
Definition pg_dump.h:732
bool subpasswordrequired
Definition pg_dump.h:720
const char * rolname
Definition pg_dump.h:714
char * subservername
Definition pg_dump.h:725
char * subsynccommit
Definition pg_dump.h:728
char * subpublications
Definition pg_dump.h:730
char * subwalrcvtimeout
Definition pg_dump.h:729
char * subslotname
Definition pg_dump.h:727
char subtwophasestate
Definition pg_dump.h:718
bool subretaindeadtuples
Definition pg_dump.h:723
char * subconninfo
Definition pg_dump.h:726
DumpableObject dobj
Definition pg_dump.h:713
DumpableObject dobj
Definition pg_dump.h:270
FuncInfo aggfn
Definition pg_dump.h:254
DumpableObject dobj
Definition pg_dump.h:404
char * adef_expr
Definition pg_dump.h:407
TableInfo * adtable
Definition pg_dump.h:405
bool separate
Definition pg_dump.h:408
char castmethod
Definition pg_dump.h:550
Oid casttarget
Definition pg_dump.h:547
char castcontext
Definition pg_dump.h:549
DumpableObject dobj
Definition pg_dump.h:545
Oid castsource
Definition pg_dump.h:546
Oid castfunc
Definition pg_dump.h:548
Oid cfgparser
Definition pg_dump.h:598
DumpableObject dobj
Definition pg_dump.h:596
const char * rolname
Definition pg_dump.h:597
int collencoding
Definition pg_dump.h:293
const char * rolname
Definition pg_dump.h:292
DumpableObject dobj
Definition pg_dump.h:291
TypeInfo * condomain
Definition pg_dump.h:520
TableInfo * contable
Definition pg_dump.h:519
DumpableObject dobj
Definition pg_dump.h:518
DumpId conindex
Definition pg_dump.h:524
bool condeferrable
Definition pg_dump.h:525
char * condef
Definition pg_dump.h:522
DumpableObject dobj
Definition pg_dump.h:298
const char * rolname
Definition pg_dump.h:299
DumpableObject dobj
Definition pg_dump.h:625
DumpableAcl dacl
Definition pg_dump.h:626
const char * defaclrole
Definition pg_dump.h:627
char defaclobjtype
Definition pg_dump.h:628
char * dictinitoption
Definition pg_dump.h:584
DumpableObject dobj
Definition pg_dump.h:581
const char * rolname
Definition pg_dump.h:582
Oid dicttemplate
Definition pg_dump.h:583
char privtype
Definition pg_dump.h:173
char * acldefault
Definition pg_dump.h:171
char * acl
Definition pg_dump.h:170
char * initprivs
Definition pg_dump.h:174
DumpableObject dobj
Definition pg_dump.h:180
DumpComponents dump
Definition pg_dump.h:153
DumpId * dependencies
Definition pg_dump.h:159
DumpId dumpId
Definition pg_dump.h:151
DumpComponents components
Definition pg_dump.h:156
DumpableObjectType objType
Definition pg_dump.h:149
CatalogId catId
Definition pg_dump.h:150
DumpComponents dump_contains
Definition pg_dump.h:155
bool depends_on_ext
Definition pg_dump.h:158
char * evtevent
Definition pg_dump.h:499
char * evtfname
Definition pg_dump.h:502
char * evtname
Definition pg_dump.h:498
const char * evtowner
Definition pg_dump.h:500
char * evttags
Definition pg_dump.h:501
DumpableObject dobj
Definition pg_dump.h:497
bool relocatable
Definition pg_dump.h:196
char * extversion
Definition pg_dump.h:198
DumpableObject dobj
Definition pg_dump.h:195
char * extcondition
Definition pg_dump.h:200
char * extconfig
Definition pg_dump.h:199
char * fdwhandler
Definition pg_dump.h:606
const char * rolname
Definition pg_dump.h:605
char * fdwvalidator
Definition pg_dump.h:607
char * fdwoptions
Definition pg_dump.h:609
DumpableAcl dacl
Definition pg_dump.h:604
char * fdwconnection
Definition pg_dump.h:608
DumpableObject dobj
Definition pg_dump.h:603
DumpableAcl dacl
Definition pg_dump.h:615
DumpableObject dobj
Definition pg_dump.h:614
const char * rolname
Definition pg_dump.h:616
bool postponed_def
Definition pg_dump.h:248
Oid lang
Definition pg_dump.h:244
const char * rolname
Definition pg_dump.h:243
Oid * argtypes
Definition pg_dump.h:246
Oid prorettype
Definition pg_dump.h:247
DumpableObject dobj
Definition pg_dump.h:241
int nargs
Definition pg_dump.h:245
DumpableAcl dacl
Definition pg_dump.h:242
IndxInfo * partitionIdx
Definition pg_dump.h:445
DumpableObject dobj
Definition pg_dump.h:443
IndxInfo * parentIdx
Definition pg_dump.h:444
bool indisreplident
Definition pg_dump.h:432
int indnkeyattrs
Definition pg_dump.h:427
char * indstatvals
Definition pg_dump.h:426
char * indstatcols
Definition pg_dump.h:425
int indnattrs
Definition pg_dump.h:428
TableInfo * indextable
Definition pg_dump.h:421
Oid parentidx
Definition pg_dump.h:434
Oid * indkeys
Definition pg_dump.h:429
char * indreloptions
Definition pg_dump.h:424
DumpId indexconstraint
Definition pg_dump.h:438
bool indisclustered
Definition pg_dump.h:431
SimplePtrList partattaches
Definition pg_dump.h:435
char * tablespace
Definition pg_dump.h:423
bool indnullsnotdistinct
Definition pg_dump.h:433
char * indexdef
Definition pg_dump.h:422
DumpableObject dobj
Definition pg_dump.h:420
Oid inhparent
Definition pg_dump.h:566
Oid inhrelid
Definition pg_dump.h:565
const char * rolname
Definition pg_dump.h:643
DumpableObject dobj
Definition pg_dump.h:641
DumpableAcl dacl
Definition pg_dump.h:642
Oid looids[FLEXIBLE_ARRAY_MEMBER]
Definition pg_dump.h:645
int numlos
Definition pg_dump.h:644
DumpableObject dobj
Definition pg_dump.h:186
DumpableAcl dacl
Definition pg_dump.h:187
const char * rolname
Definition pg_dump.h:190
Oid opcmethod
Definition pg_dump.h:278
DumpableObject dobj
Definition pg_dump.h:277
const char * rolname
Definition pg_dump.h:279
const char * rolname
Definition pg_dump.h:286
DumpableObject dobj
Definition pg_dump.h:284
DumpableObject dobj
Definition pg_dump.h:260
Oid oprleft
Definition pg_dump.h:263
char oprkind
Definition pg_dump.h:262
Oid oprcode
Definition pg_dump.h:265
Oid oprright
Definition pg_dump.h:264
const char * rolname
Definition pg_dump.h:261
TableInfo * poltable
Definition pg_dump.h:657
char * polqual
Definition pg_dump.h:662
char polcmd
Definition pg_dump.h:659
char * polroles
Definition pg_dump.h:661
char * polwithcheck
Definition pg_dump.h:663
DumpableObject dobj
Definition pg_dump.h:656
bool polpermissive
Definition pg_dump.h:660
char * polname
Definition pg_dump.h:658
Oid lanvalidator
Definition pg_dump.h:539
DumpableAcl dacl
Definition pg_dump.h:535
DumpableObject dobj
Definition pg_dump.h:534
const char * lanowner
Definition pg_dump.h:540
Oid lanplcallfoid
Definition pg_dump.h:537
bool lanpltrusted
Definition pg_dump.h:536
DumpableObject dobj
Definition pg_dump.h:571
Oid prstoken
Definition pg_dump.h:573
Oid prslextype
Definition pg_dump.h:576
Oid prsheadline
Definition pg_dump.h:575
Oid prsstart
Definition pg_dump.h:572
Oid prsend
Definition pg_dump.h:574
int32 nindAttNames
Definition pg_dump.h:463
char ** indAttNames
Definition pg_dump.h:462
int32 relpages
Definition pg_dump.h:452
int32 relallfrozen
Definition pg_dump.h:455
char * reltuples
Definition pg_dump.h:453
teSection section
Definition pg_dump.h:464
int32 relallvisible
Definition pg_dump.h:454
DumpableObject dobj
Definition pg_dump.h:450
DumpableObject dobj
Definition pg_dump.h:477
bool separate
Definition pg_dump.h:482
char ev_enabled
Definition pg_dump.h:481
bool is_instead
Definition pg_dump.h:480
TableInfo * ruletable
Definition pg_dump.h:478
char ev_type
Definition pg_dump.h:479
TypeInfo * baseType
Definition pg_dump.h:236
DumpableObject dobj
Definition pg_dump.h:234
TableInfo * stattable
Definition pg_dump.h:471
const char * rolname
Definition pg_dump.h:470
DumpableObject dobj
Definition pg_dump.h:469
TableInfo * partitionTbl
Definition pg_dump.h:399
DumpableObject dobj
Definition pg_dump.h:397
TableInfo * parentTbl
Definition pg_dump.h:398
TableInfo * tdtable
Definition pg_dump.h:414
DumpableObject dobj
Definition pg_dump.h:413
char * filtercond
Definition pg_dump.h:415
bool * notnull_invalid
Definition pg_dump.h:376
char * attidentity
Definition pg_dump.h:361
char * reltablespace
Definition pg_dump.h:314
char ** notnull_constrs
Definition pg_dump.h:371
struct _relStatsInfo * stats
Definition pg_dump.h:381
int ncheck
Definition pg_dump.h:330
bool ispartition
Definition pg_dump.h:344
struct _indxInfo * indexes
Definition pg_dump.h:389
bool * attislocal
Definition pg_dump.h:365
DumpableObject dobj
Definition pg_dump.h:307
bool is_identity_sequence
Definition pg_dump.h:337
Oid reloftype
Definition pg_dump.h:332
int numParents
Definition pg_dump.h:347
bool interesting
Definition pg_dump.h:341
char * toast_reloptions
Definition pg_dump.h:317
struct _tableInfo ** parents
Definition pg_dump.h:348
DumpableAcl dacl
Definition pg_dump.h:308
bool relispopulated
Definition pg_dump.h:312
char * attgenerated
Definition pg_dump.h:362
int * attlen
Definition pg_dump.h:363
Oid reltype
Definition pg_dump.h:331
char ** attfdwoptions
Definition pg_dump.h:369
bool hasoids
Definition pg_dump.h:324
Oid toast_oid
Definition pg_dump.h:327
Oid foreign_server
Definition pg_dump.h:333
char ** notnull_comment
Definition pg_dump.h:375
bool hasrules
Definition pg_dump.h:319
struct _triggerInfo * triggers
Definition pg_dump.h:392
bool * attisdropped
Definition pg_dump.h:360
bool needs_override
Definition pg_dump.h:382
struct _constraintInfo * checkexprs
Definition pg_dump.h:380
int * attstattarget
Definition pg_dump.h:357
bool * notnull_islocal
Definition pg_dump.h:378
uint32 frozenxid
Definition pg_dump.h:325
char * typstorage
Definition pg_dump.h:359
int owning_col
Definition pg_dump.h:336
char * checkoption
Definition pg_dump.h:316
int numatts
Definition pg_dump.h:354
bool hastriggers
Definition pg_dump.h:320
const char * rolname
Definition pg_dump.h:309
struct _attrDefInfo ** attrdefs
Definition pg_dump.h:379
char ** attoptions
Definition pg_dump.h:366
char relreplident
Definition pg_dump.h:313
int numTriggers
Definition pg_dump.h:391
uint32 minmxid
Definition pg_dump.h:326
Oid * attcollation
Definition pg_dump.h:367
bool * notnull_noinh
Definition pg_dump.h:377
char * attstorage
Definition pg_dump.h:358
int toastpages
Definition pg_dump.h:339
Oid owning_tab
Definition pg_dump.h:335
struct _tableDataInfo * dataObj
Definition pg_dump.h:390
char * amname
Definition pg_dump.h:383
bool dummy_view
Definition pg_dump.h:342
int32 relpages
Definition pg_dump.h:338
bool forcerowsec
Definition pg_dump.h:323
bool hascolumnACLs
Definition pg_dump.h:321
char ** atttypnames
Definition pg_dump.h:356
char ** attmissingval
Definition pg_dump.h:370
char relpersistence
Definition pg_dump.h:311
char ** attnames
Definition pg_dump.h:355
char relkind
Definition pg_dump.h:310
bool hasindex
Definition pg_dump.h:318
bool unsafe_partitions
Definition pg_dump.h:345
char * reloptions
Definition pg_dump.h:315
int numIndexes
Definition pg_dump.h:388
uint32 toast_frozenxid
Definition pg_dump.h:328
uint32 toast_minmxid
Definition pg_dump.h:329
char * attalign
Definition pg_dump.h:364
char * attcompression
Definition pg_dump.h:368
bool postponed_def
Definition pg_dump.h:343
bool rowsec
Definition pg_dump.h:322
Oid tmpllexize
Definition pg_dump.h:591
Oid tmplinit
Definition pg_dump.h:590
DumpableObject dobj
Definition pg_dump.h:589
DumpableObject dobj
Definition pg_dump.h:555
TableInfo * tgtable
Definition pg_dump.h:489
DumpableObject dobj
Definition pg_dump.h:488
char tgenabled
Definition pg_dump.h:490
char * tgdef
Definition pg_dump.h:492
bool tgispartition
Definition pg_dump.h:491
bool isMultirange
Definition pg_dump.h:221
struct _constraintInfo * domChecks
Definition pg_dump.h:229
DumpableAcl dacl
Definition pg_dump.h:206
DumpableObject dobj
Definition pg_dump.h:205
bool isDefined
Definition pg_dump.h:222
char * ftypname
Definition pg_dump.h:213
char typrelkind
Definition pg_dump.h:218
Oid typarray
Definition pg_dump.h:217
Oid typelem
Definition pg_dump.h:215
struct _shellTypeInfo * shellType
Definition pg_dump.h:224
int nDomChecks
Definition pg_dump.h:228
struct _constraintInfo * notnull
Definition pg_dump.h:226
char typtype
Definition pg_dump.h:219
const char * rolname
Definition pg_dump.h:214
Oid typrelid
Definition pg_dump.h:216
bool isArray
Definition pg_dump.h:220