1 /*-------------------------------------------------------------------------
2  *
3  * pg_dump.h
4  *	  Common header file for the pg_dump utility
5  *
6  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/bin/pg_dump/pg_dump.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 
14 #ifndef PG_DUMP_H
15 #define PG_DUMP_H
16 
17 #include "pg_backup.h"
18 
19 
20 #define oidcmp(x,y) ( ((x) < (y) ? -1 : ((x) > (y)) ?  1 : 0) )
21 #define oideq(x,y) ( (x) == (y) )
22 #define oidle(x,y) ( (x) <= (y) )
23 #define oidge(x,y) ( (x) >= (y) )
24 #define oidzero(x) ( (x) == 0 )
25 
26 /*
27  * The data structures used to store system catalog information.  Every
28  * dumpable object is a subclass of DumpableObject.
29  *
30  * NOTE: the structures described here live for the entire pg_dump run;
31  * and in most cases we make a struct for every object we can find in the
32  * catalogs, not only those we are actually going to dump.  Hence, it's
33  * best to store a minimal amount of per-object info in these structs,
34  * and retrieve additional per-object info when and if we dump a specific
35  * object.  In particular, try to avoid retrieving expensive-to-compute
36  * information until it's known to be needed.  We do, however, have to
37  * store enough info to determine whether an object should be dumped and
38  * what order to dump in.
39  */
40 
41 typedef enum
42 {
43 	/* When modifying this enum, update priority tables in pg_dump_sort.c! */
44 	DO_NAMESPACE,
45 	DO_EXTENSION,
46 	DO_TYPE,
47 	DO_SHELL_TYPE,
48 	DO_FUNC,
49 	DO_AGG,
50 	DO_OPERATOR,
51 	DO_ACCESS_METHOD,
52 	DO_OPCLASS,
53 	DO_OPFAMILY,
54 	DO_COLLATION,
55 	DO_CONVERSION,
56 	DO_TABLE,
57 	DO_ATTRDEF,
58 	DO_INDEX,
59 	DO_RULE,
60 	DO_TRIGGER,
61 	DO_CONSTRAINT,
62 	DO_FK_CONSTRAINT,			/* see note for ConstraintInfo */
63 	DO_PROCLANG,
64 	DO_CAST,
65 	DO_TABLE_DATA,
66 	DO_DUMMY_TYPE,
67 	DO_TSPARSER,
68 	DO_TSDICT,
69 	DO_TSTEMPLATE,
70 	DO_TSCONFIG,
71 	DO_FDW,
72 	DO_FOREIGN_SERVER,
73 	DO_DEFAULT_ACL,
74 	DO_TRANSFORM,
75 	DO_BLOB,
76 	DO_BLOB_DATA,
77 	DO_PRE_DATA_BOUNDARY,
78 	DO_POST_DATA_BOUNDARY,
79 	DO_EVENT_TRIGGER,
80 	DO_REFRESH_MATVIEW,
81 	DO_POLICY
82 } DumpableObjectType;
83 
84 /* component types of an object which can be selected for dumping */
85 typedef uint32 DumpComponents;	/* a bitmask of dump object components */
86 #define DUMP_COMPONENT_NONE			(0)
87 #define DUMP_COMPONENT_DEFINITION	(1 << 0)
88 #define DUMP_COMPONENT_DATA			(1 << 1)
89 #define DUMP_COMPONENT_COMMENT		(1 << 2)
90 #define DUMP_COMPONENT_SECLABEL		(1 << 3)
91 #define DUMP_COMPONENT_ACL			(1 << 4)
92 #define DUMP_COMPONENT_POLICY		(1 << 5)
93 #define DUMP_COMPONENT_USERMAP		(1 << 6)
94 #define DUMP_COMPONENT_ALL			(0xFFFF)
95 
96 /*
97  * component types which require us to obtain a lock on the table
98  *
99  * Note that some components only require looking at the information
100  * in the pg_catalog tables and, for those components, we do not need
101  * to lock the table.  Be careful here though- some components use
102  * server-side functions which pull the latest information from
103  * SysCache and in those cases we *do* need to lock the table.
104  *
105  * We do not need locks for the COMMENT and SECLABEL components as
106  * those simply query their associated tables without using any
107  * server-side functions.  We do not need locks for the ACL component
108  * as we pull that information from pg_class without using any
109  * server-side functions that use SysCache.  The USERMAP component
110  * is only relevant for FOREIGN SERVERs and not tables, so no sense
111  * locking a table for that either (that can happen if we are going
112  * to dump "ALL" components for a table).
113  *
114  * We DO need locks for DEFINITION, due to various server-side
115  * functions that are used and POLICY due to pg_get_expr().  We set
116  * this up to grab the lock except in the cases we know to be safe.
117  */
118 #define DUMP_COMPONENTS_REQUIRING_LOCK (\
119 		DUMP_COMPONENT_DEFINITION |\
120 		DUMP_COMPONENT_DATA |\
121 		DUMP_COMPONENT_POLICY)
122 
123 typedef struct _dumpableObject
124 {
125 	DumpableObjectType objType;
126 	CatalogId	catId;			/* zero if not a cataloged object */
127 	DumpId		dumpId;			/* assigned by AssignDumpId() */
128 	char	   *name;			/* object name (should never be NULL) */
129 	struct _namespaceInfo *namespace;	/* containing namespace, or NULL */
130 	DumpComponents dump;		/* bitmask of components to dump */
131 	DumpComponents dump_contains;		/* as above, but for contained objects */
132 	bool		ext_member;		/* true if object is member of extension */
133 	bool		depends_on_ext;	/* true if object depends on an extension */
134 	DumpId	   *dependencies;	/* dumpIds of objects this one depends on */
135 	int			nDeps;			/* number of valid dependencies */
136 	int			allocDeps;		/* allocated size of dependencies[] */
137 } DumpableObject;
138 
139 typedef struct _namespaceInfo
140 {
141 	DumpableObject dobj;
142 	char	   *rolname;		/* name of owner, or empty string */
143 	char	   *nspacl;
144 	char	   *rnspacl;
145 	char	   *initnspacl;
146 	char	   *initrnspacl;
147 } NamespaceInfo;
148 
149 typedef struct _extensionInfo
150 {
151 	DumpableObject dobj;
152 	char	   *namespace;		/* schema containing extension's objects */
153 	bool		relocatable;
154 	char	   *extversion;
155 	char	   *extconfig;		/* info about configuration tables */
156 	char	   *extcondition;
157 } ExtensionInfo;
158 
159 typedef struct _typeInfo
160 {
161 	DumpableObject dobj;
162 
163 	/*
164 	 * Note: dobj.name is the raw pg_type.typname entry.  ftypname is the
165 	 * result of format_type(), which will be quoted if needed, and might be
166 	 * schema-qualified too.
167 	 */
168 	char	   *ftypname;
169 	char	   *rolname;		/* name of owner, or empty string */
170 	char	   *typacl;
171 	char	   *rtypacl;
172 	char	   *inittypacl;
173 	char	   *initrtypacl;
174 	Oid			typelem;
175 	Oid			typrelid;
176 	char		typrelkind;		/* 'r', 'v', 'c', etc */
177 	char		typtype;		/* 'b', 'c', etc */
178 	bool		isArray;		/* true if auto-generated array type */
179 	bool		isDefined;		/* true if typisdefined */
180 	/* If needed, we'll create a "shell type" entry for it; link that here: */
181 	struct _shellTypeInfo *shellType;	/* shell-type entry, or NULL */
182 	/* If it's a domain, we store links to its constraints here: */
183 	int			nDomChecks;
184 	struct _constraintInfo *domChecks;
185 } TypeInfo;
186 
187 typedef struct _shellTypeInfo
188 {
189 	DumpableObject dobj;
190 
191 	TypeInfo   *baseType;		/* back link to associated base type */
192 } ShellTypeInfo;
193 
194 typedef struct _funcInfo
195 {
196 	DumpableObject dobj;
197 	char	   *rolname;		/* name of owner, or empty string */
198 	Oid			lang;
199 	int			nargs;
200 	Oid		   *argtypes;
201 	Oid			prorettype;
202 	char	   *proacl;
203 	char	   *rproacl;
204 	char	   *initproacl;
205 	char	   *initrproacl;
206 } FuncInfo;
207 
208 /* AggInfo is a superset of FuncInfo */
209 typedef struct _aggInfo
210 {
211 	FuncInfo	aggfn;
212 	/* we don't require any other fields at the moment */
213 } AggInfo;
214 
215 typedef struct _oprInfo
216 {
217 	DumpableObject dobj;
218 	char	   *rolname;
219 	char		oprkind;
220 	Oid			oprcode;
221 } OprInfo;
222 
223 typedef struct _accessMethodInfo
224 {
225 	DumpableObject dobj;
226 	char		amtype;
227 	char	   *amhandler;
228 } AccessMethodInfo;
229 
230 typedef struct _opclassInfo
231 {
232 	DumpableObject dobj;
233 	char	   *rolname;
234 } OpclassInfo;
235 
236 typedef struct _opfamilyInfo
237 {
238 	DumpableObject dobj;
239 	char	   *rolname;
240 } OpfamilyInfo;
241 
242 typedef struct _collInfo
243 {
244 	DumpableObject dobj;
245 	char	   *rolname;
246 } CollInfo;
247 
248 typedef struct _convInfo
249 {
250 	DumpableObject dobj;
251 	char	   *rolname;
252 } ConvInfo;
253 
254 typedef struct _tableInfo
255 {
256 	/*
257 	 * These fields are collected for every table in the database.
258 	 */
259 	DumpableObject dobj;
260 	char	   *rolname;		/* name of owner, or empty string */
261 	char	   *relacl;
262 	char	   *rrelacl;
263 	char	   *initrelacl;
264 	char	   *initrrelacl;
265 	char		relkind;
266 	char		relpersistence; /* relation persistence */
267 	bool		relispopulated; /* relation is populated */
268 	char		relreplident;	/* replica identifier */
269 	char	   *reltablespace;	/* relation tablespace */
270 	char	   *reloptions;		/* options specified by WITH (...) */
271 	char	   *checkoption;	/* WITH CHECK OPTION, if any */
272 	char	   *toast_reloptions;		/* WITH options for the TOAST table */
273 	bool		hasindex;		/* does it have any indexes? */
274 	bool		hasrules;		/* does it have any rules? */
275 	bool		hastriggers;	/* does it have any triggers? */
276 	bool		rowsec;			/* is row security enabled? */
277 	bool		forcerowsec;	/* is row security forced? */
278 	bool		hasoids;		/* does it have OIDs? */
279 	uint32		frozenxid;		/* table's relfrozenxid */
280 	uint32		minmxid;		/* table's relminmxid */
281 	Oid			toast_oid;		/* toast table's OID, or 0 if none */
282 	uint32		toast_frozenxid;	/* toast table's relfrozenxid, if any */
283 	uint32		toast_minmxid;	/* toast table's relminmxid */
284 	int			ncheck;			/* # of CHECK expressions */
285 	char	   *reloftype;		/* underlying type for typed table */
286 	/* these two are set only if table is a sequence owned by a column: */
287 	Oid			owning_tab;		/* OID of table owning sequence */
288 	int			owning_col;		/* attr # of column owning sequence */
289 	int			relpages;		/* table's size in pages (from pg_class) */
290 
291 	bool		interesting;	/* true if need to collect more data */
292 	bool		dummy_view;		/* view's real definition must be postponed */
293 	bool		postponed_def;	/* matview must be postponed into post-data */
294 
295 	/*
296 	 * These fields are computed only if we decide the table is interesting
297 	 * (it's either a table to dump, or a direct parent of a dumpable table).
298 	 */
299 	int			numatts;		/* number of attributes */
300 	char	  **attnames;		/* the attribute names */
301 	char	  **atttypnames;	/* attribute type names */
302 	int		   *atttypmod;		/* type-specific type modifiers */
303 	int		   *attstattarget;	/* attribute statistics targets */
304 	char	   *attstorage;		/* attribute storage scheme */
305 	char	   *typstorage;		/* type storage scheme */
306 	bool	   *attisdropped;	/* true if attr is dropped; don't dump it */
307 	int		   *attlen;			/* attribute length, used by binary_upgrade */
308 	char	   *attalign;		/* attribute align, used by binary_upgrade */
309 	bool	   *attislocal;		/* true if attr has local definition */
310 	char	  **attoptions;		/* per-attribute options */
311 	Oid		   *attcollation;	/* per-attribute collation selection */
312 	char	  **attfdwoptions;	/* per-attribute fdw options */
313 	bool	   *notnull;		/* NOT NULL constraints on attributes */
314 	bool	   *inhNotNull;		/* true if NOT NULL is inherited */
315 	struct _attrDefInfo **attrdefs;		/* DEFAULT expressions */
316 	struct _constraintInfo *checkexprs; /* CHECK constraints */
317 
318 	/*
319 	 * Stuff computed only for dumpable tables.
320 	 */
321 	int			numParents;		/* number of (immediate) parent tables */
322 	struct _tableInfo **parents;	/* TableInfos of immediate parents */
323 	struct _tableDataInfo *dataObj;		/* TableDataInfo, if dumping its data */
324 	int			numTriggers;	/* number of triggers for table */
325 	struct _triggerInfo *triggers;		/* array of TriggerInfo structs */
326 } TableInfo;
327 
328 typedef struct _attrDefInfo
329 {
330 	DumpableObject dobj;		/* note: dobj.name is name of table */
331 	TableInfo  *adtable;		/* link to table of attribute */
332 	int			adnum;
333 	char	   *adef_expr;		/* decompiled DEFAULT expression */
334 	bool		separate;		/* TRUE if must dump as separate item */
335 } AttrDefInfo;
336 
337 typedef struct _tableDataInfo
338 {
339 	DumpableObject dobj;
340 	TableInfo  *tdtable;		/* link to table to dump */
341 	bool		oids;			/* include OIDs in data? */
342 	char	   *filtercond;		/* WHERE condition to limit rows dumped */
343 } TableDataInfo;
344 
345 typedef struct _indxInfo
346 {
347 	DumpableObject dobj;
348 	TableInfo  *indextable;		/* link to table the index is for */
349 	char	   *indexdef;
350 	char	   *tablespace;		/* tablespace in which index is stored */
351 	char	   *indreloptions;	/* options specified by WITH (...) */
352 	int			indnkeys;
353 	Oid		   *indkeys;
354 	bool		indisclustered;
355 	bool		indisreplident;
356 	/* if there is an associated constraint object, its dumpId: */
357 	DumpId		indexconstraint;
358 	int			relpages;		/* relpages of the underlying table */
359 } IndxInfo;
360 
361 typedef struct _ruleInfo
362 {
363 	DumpableObject dobj;
364 	TableInfo  *ruletable;		/* link to table the rule is for */
365 	char		ev_type;
366 	bool		is_instead;
367 	char		ev_enabled;
368 	bool		separate;		/* TRUE if must dump as separate item */
369 	/* separate is always true for non-ON SELECT rules */
370 } RuleInfo;
371 
372 typedef struct _triggerInfo
373 {
374 	DumpableObject dobj;
375 	TableInfo  *tgtable;		/* link to table the trigger is for */
376 	char	   *tgfname;
377 	int			tgtype;
378 	int			tgnargs;
379 	char	   *tgargs;
380 	bool		tgisconstraint;
381 	char	   *tgconstrname;
382 	Oid			tgconstrrelid;
383 	char	   *tgconstrrelname;
384 	char		tgenabled;
385 	bool		tgdeferrable;
386 	bool		tginitdeferred;
387 	char	   *tgdef;
388 } TriggerInfo;
389 
390 typedef struct _evttriggerInfo
391 {
392 	DumpableObject dobj;
393 	char	   *evtname;
394 	char	   *evtevent;
395 	char	   *evtowner;
396 	char	   *evttags;
397 	char	   *evtfname;
398 	char		evtenabled;
399 } EventTriggerInfo;
400 
401 /*
402  * struct ConstraintInfo is used for all constraint types.  However we
403  * use a different objType for foreign key constraints, to make it easier
404  * to sort them the way we want.
405  *
406  * Note: condeferrable and condeferred are currently only valid for
407  * unique/primary-key constraints.  Otherwise that info is in condef.
408  */
409 typedef struct _constraintInfo
410 {
411 	DumpableObject dobj;
412 	TableInfo  *contable;		/* NULL if domain constraint */
413 	TypeInfo   *condomain;		/* NULL if table constraint */
414 	char		contype;
415 	char	   *condef;			/* definition, if CHECK or FOREIGN KEY */
416 	Oid			confrelid;		/* referenced table, if FOREIGN KEY */
417 	DumpId		conindex;		/* identifies associated index if any */
418 	bool		condeferrable;	/* TRUE if constraint is DEFERRABLE */
419 	bool		condeferred;	/* TRUE if constraint is INITIALLY DEFERRED */
420 	bool		conislocal;		/* TRUE if constraint has local definition */
421 	bool		separate;		/* TRUE if must dump as separate item */
422 } ConstraintInfo;
423 
424 typedef struct _procLangInfo
425 {
426 	DumpableObject dobj;
427 	bool		lanpltrusted;
428 	Oid			lanplcallfoid;
429 	Oid			laninline;
430 	Oid			lanvalidator;
431 	char	   *lanacl;
432 	char	   *rlanacl;
433 	char	   *initlanacl;
434 	char	   *initrlanacl;
435 	char	   *lanowner;		/* name of owner, or empty string */
436 } ProcLangInfo;
437 
438 typedef struct _castInfo
439 {
440 	DumpableObject dobj;
441 	Oid			castsource;
442 	Oid			casttarget;
443 	Oid			castfunc;
444 	char		castcontext;
445 	char		castmethod;
446 } CastInfo;
447 
448 typedef struct _transformInfo
449 {
450 	DumpableObject dobj;
451 	Oid			trftype;
452 	Oid			trflang;
453 	Oid			trffromsql;
454 	Oid			trftosql;
455 } TransformInfo;
456 
457 /* InhInfo isn't a DumpableObject, just temporary state */
458 typedef struct _inhInfo
459 {
460 	Oid			inhrelid;		/* OID of a child table */
461 	Oid			inhparent;		/* OID of its parent */
462 } InhInfo;
463 
464 typedef struct _prsInfo
465 {
466 	DumpableObject dobj;
467 	Oid			prsstart;
468 	Oid			prstoken;
469 	Oid			prsend;
470 	Oid			prsheadline;
471 	Oid			prslextype;
472 } TSParserInfo;
473 
474 typedef struct _dictInfo
475 {
476 	DumpableObject dobj;
477 	char	   *rolname;
478 	Oid			dicttemplate;
479 	char	   *dictinitoption;
480 } TSDictInfo;
481 
482 typedef struct _tmplInfo
483 {
484 	DumpableObject dobj;
485 	Oid			tmplinit;
486 	Oid			tmpllexize;
487 } TSTemplateInfo;
488 
489 typedef struct _cfgInfo
490 {
491 	DumpableObject dobj;
492 	char	   *rolname;
493 	Oid			cfgparser;
494 } TSConfigInfo;
495 
496 typedef struct _fdwInfo
497 {
498 	DumpableObject dobj;
499 	char	   *rolname;
500 	char	   *fdwhandler;
501 	char	   *fdwvalidator;
502 	char	   *fdwoptions;
503 	char	   *fdwacl;
504 	char	   *rfdwacl;
505 	char	   *initfdwacl;
506 	char	   *initrfdwacl;
507 } FdwInfo;
508 
509 typedef struct _foreignServerInfo
510 {
511 	DumpableObject dobj;
512 	char	   *rolname;
513 	Oid			srvfdw;
514 	char	   *srvtype;
515 	char	   *srvversion;
516 	char	   *srvacl;
517 	char	   *rsrvacl;
518 	char	   *initsrvacl;
519 	char	   *initrsrvacl;
520 	char	   *srvoptions;
521 } ForeignServerInfo;
522 
523 typedef struct _defaultACLInfo
524 {
525 	DumpableObject dobj;
526 	char	   *defaclrole;
527 	char		defaclobjtype;
528 	char	   *defaclacl;
529 	char	   *rdefaclacl;
530 	char	   *initdefaclacl;
531 	char	   *initrdefaclacl;
532 } DefaultACLInfo;
533 
534 typedef struct _blobInfo
535 {
536 	DumpableObject dobj;
537 	char	   *rolname;
538 	char	   *blobacl;
539 	char	   *rblobacl;
540 	char	   *initblobacl;
541 	char	   *initrblobacl;
542 } BlobInfo;
543 
544 /*
545  * The PolicyInfo struct is used to represent policies on a table and
546  * to indicate if a table has RLS enabled (ENABLE ROW SECURITY).  If
547  * polname is NULL, then the record indicates ENABLE ROW SECURITY, while if
548  * it's non-NULL then this is a regular policy definition.
549  */
550 typedef struct _policyInfo
551 {
552 	DumpableObject dobj;
553 	TableInfo  *poltable;
554 	char	   *polname;		/* null indicates RLS is enabled on rel */
555 	char	   *polcmd;
556 	char	   *polroles;
557 	char	   *polqual;
558 	char	   *polwithcheck;
559 } PolicyInfo;
560 
561 /*
562  * We build an array of these with an entry for each object that is an
563  * extension member according to pg_depend.
564  */
565 typedef struct _extensionMemberId
566 {
567 	CatalogId	catId;			/* tableoid+oid of some member object */
568 	ExtensionInfo *ext;			/* owning extension */
569 } ExtensionMemberId;
570 
571 /* global decls */
572 extern bool force_quotes;		/* double-quotes for identifiers flag */
573 extern bool g_verbose;			/* verbose flag */
574 
575 /* placeholders for comment starting and ending delimiters */
576 extern char g_comment_start[10];
577 extern char g_comment_end[10];
578 
579 extern char g_opaque_type[10];	/* name for the opaque type */
580 
581 /*
582  *	common utility functions
583  */
584 
585 extern TableInfo *getSchemaData(Archive *fout, int *numTablesPtr);
586 
587 extern void AssignDumpId(DumpableObject *dobj);
588 extern DumpId createDumpId(void);
589 extern DumpId getMaxDumpId(void);
590 extern DumpableObject *findObjectByDumpId(DumpId dumpId);
591 extern DumpableObject *findObjectByCatalogId(CatalogId catalogId);
592 extern void getDumpableObjects(DumpableObject ***objs, int *numObjs);
593 
594 extern void addObjectDependency(DumpableObject *dobj, DumpId refId);
595 extern void removeObjectDependency(DumpableObject *dobj, DumpId refId);
596 
597 extern TableInfo *findTableByOid(Oid oid);
598 extern TypeInfo *findTypeByOid(Oid oid);
599 extern FuncInfo *findFuncByOid(Oid oid);
600 extern OprInfo *findOprByOid(Oid oid);
601 extern CollInfo *findCollationByOid(Oid oid);
602 extern NamespaceInfo *findNamespaceByOid(Oid oid);
603 extern ExtensionInfo *findExtensionByOid(Oid oid);
604 
605 extern void setExtensionMembership(ExtensionMemberId *extmems, int nextmems);
606 extern ExtensionInfo *findOwningExtension(CatalogId catalogId);
607 
608 extern void parseOidArray(const char *str, Oid *array, int arraysize);
609 
610 extern void sortDumpableObjects(DumpableObject **objs, int numObjs,
611 					DumpId preBoundaryId, DumpId postBoundaryId);
612 extern void sortDumpableObjectsByTypeName(DumpableObject **objs, int numObjs);
613 extern void sortDumpableObjectsByTypeOid(DumpableObject **objs, int numObjs);
614 extern void sortDataAndIndexObjectsBySize(DumpableObject **objs, int numObjs);
615 
616 /*
617  * version specific routines
618  */
619 extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
620 extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
621 extern TypeInfo *getTypes(Archive *fout, int *numTypes);
622 extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
623 extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
624 extern OprInfo *getOperators(Archive *fout, int *numOperators);
625 extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
626 extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
627 extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
628 extern CollInfo *getCollations(Archive *fout, int *numCollations);
629 extern ConvInfo *getConversions(Archive *fout, int *numConversions);
630 extern TableInfo *getTables(Archive *fout, int *numTables);
631 extern void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables);
632 extern InhInfo *getInherits(Archive *fout, int *numInherits);
633 extern void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables);
634 extern void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables);
635 extern RuleInfo *getRules(Archive *fout, int *numRules);
636 extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
637 extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
638 extern CastInfo *getCasts(Archive *fout, int *numCasts);
639 extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
640 extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
641 extern bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno);
642 extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
643 extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
644 extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
645 extern TSConfigInfo *getTSConfigurations(Archive *fout, int *numTSConfigs);
646 extern FdwInfo *getForeignDataWrappers(Archive *fout,
647 					   int *numForeignDataWrappers);
648 extern ForeignServerInfo *getForeignServers(Archive *fout,
649 				  int *numForeignServers);
650 extern DefaultACLInfo *getDefaultACLs(Archive *fout, int *numDefaultACLs);
651 extern void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
652 					   int numExtensions);
653 extern void processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
654 					   int numExtensions);
655 extern EventTriggerInfo *getEventTriggers(Archive *fout, int *numEventTriggers);
656 extern void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables);
657 
658 #endif   /* PG_DUMP_H */
659