* pg_dump.h
* Common header file for the pg_dump utility
*
- * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.144 2008/12/19 16:25:18 petere Exp $
+ * src/bin/pg_dump/pg_dump.h
*
*-------------------------------------------------------------------------
*/
#include "postgres_fe.h"
-/*
- * WIN32 does not provide 64-bit off_t, but does provide the functions operating
- * with 64-bit offsets.
- */
-#ifdef WIN32
-#define pgoff_t __int64
-#undef fseeko
-#undef ftello
-#ifdef WIN32_ONLY_COMPILER
-#define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin)
-#define ftello(stream) _ftelli64(stream)
-#else
-#define fseeko(stream, offset, origin) fseeko64(stream, offset, origin)
-#define ftello(stream) ftello64(stream)
-#endif
-#else
-#define pgoff_t off_t
-#endif
-
/*
* pg_dump uses two different mechanisms for identifying database objects:
*
DO_PROCLANG,
DO_CAST,
DO_TABLE_DATA,
- DO_TABLE_TYPE,
+ DO_DUMMY_TYPE,
DO_TSPARSER,
DO_TSDICT,
DO_TSTEMPLATE,
DO_TSCONFIG,
DO_FDW,
DO_FOREIGN_SERVER,
- DO_BLOBS,
- DO_BLOB_COMMENTS
+ DO_DEFAULT_ACL,
+ DO_BLOB,
+ DO_BLOB_DATA
} DumpableObjectType;
typedef struct _dumpableObject
char *rolname; /* name of owner, or empty string */
char *relacl;
char relkind;
+ char relpersistence; /* relation persistence */
char *reltablespace; /* relation tablespace */
char *reloptions; /* options specified by WITH (...) */
+ char *toast_reloptions; /* ditto, for the TOAST table */
bool hasindex; /* does it have any indexes? */
bool hasrules; /* does it have any rules? */
bool hastriggers; /* does it have any triggers? */
bool hasoids; /* does it have OIDs? */
+ uint32 frozenxid; /* for restore frozen xid */
int ncheck; /* # of CHECK expressions */
+ char *reloftype; /* underlying type for typed table */
/* these two are set only if table is a sequence owned by a column: */
Oid owning_tab; /* OID of table owning sequence */
int owning_col; /* attr # of column owning sequence */
char *attstorage; /* attribute storage scheme */
char *typstorage; /* type storage scheme */
bool *attisdropped; /* true if attr is dropped; don't dump it */
+ int *attlen; /* attribute length, used by binary_upgrade */
+ char *attalign; /* attribute align, used by binary_upgrade */
bool *attislocal; /* true if attr has local definition */
+ char **attoptions; /* per-attribute options */
/*
* Note: we need to store per-attribute notnull, default, and constraint
*/
int numParents; /* number of (immediate) parent tables */
struct _tableInfo **parents; /* TableInfos of immediate parents */
- struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
+ struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
} TableInfo;
typedef struct _attrDefInfo
char tgenabled;
bool tgdeferrable;
bool tginitdeferred;
+ char *tgdef;
} TriggerInfo;
/*
* struct ConstraintInfo is used for all constraint types. However we
* use a different objType for foreign key constraints, to make it easier
* to sort them the way we want.
+ *
+ * Note: condeferrable and condeferred are currently only valid for
+ * unique/primary-key constraints. Otherwise that info is in condef.
*/
typedef struct _constraintInfo
{
char *condef; /* definition, if CHECK or FOREIGN KEY */
Oid confrelid; /* referenced table, if FOREIGN KEY */
DumpId conindex; /* identifies associated index if any */
+ bool condeferrable; /* TRUE if constraint is DEFERRABLE */
+ bool condeferred; /* TRUE if constraint is INITIALLY DEFERRED */
bool conislocal; /* TRUE if constraint has local definition */
bool separate; /* TRUE if must dump as separate item */
} ConstraintInfo;
DumpableObject dobj;
bool lanpltrusted;
Oid lanplcallfoid;
+ Oid laninline;
Oid lanvalidator;
char *lanacl;
char *lanowner; /* name of owner, or empty string */
{
DumpableObject dobj;
char *rolname;
- char *fdwlibrary;
+ char *fdwvalidator;
char *fdwoptions;
char *fdwacl;
} FdwInfo;
char *srvoptions;
} ForeignServerInfo;
+typedef struct _defaultACLInfo
+{
+ DumpableObject dobj;
+ char *defaclrole;
+ char defaclobjtype;
+ char *defaclacl;
+} DefaultACLInfo;
+
+typedef struct _blobInfo
+{
+ DumpableObject dobj;
+ char *rolname;
+ char *blobacl;
+} BlobInfo;
+
/* global decls */
extern bool force_quotes; /* double-quotes for identifiers flag */
extern bool g_verbose; /* verbose flag */
extern TSConfigInfo *getTSConfigurations(int *numTSConfigs);
extern FdwInfo *getForeignDataWrappers(int *numForeignDataWrappers);
extern ForeignServerInfo *getForeignServers(int *numForeignServers);
+extern DefaultACLInfo *getDefaultACLs(int *numDefaultACLs);
#endif /* PG_DUMP_H */