]> granicus.if.org Git - postgresql/blobdiff - src/bin/pg_dump/pg_dump.h
Stamp copyrights for year 2011.
[postgresql] / src / bin / pg_dump / pg_dump.h
index a22e5abeb4f5bc20455122d42fa9856a9cd11073..43fd1ade27f0bf1ec8127c5526e65bdb14343ab3 100644 (file)
@@ -3,10 +3,10 @@
  * 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:
  *
@@ -126,15 +107,16 @@ typedef enum
        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
@@ -238,13 +220,17 @@ typedef struct _tableInfo
        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 */
@@ -263,7 +249,10 @@ typedef struct _tableInfo
        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
@@ -282,7 +271,7 @@ typedef struct _tableInfo
         */
        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
@@ -341,12 +330,16 @@ typedef struct _triggerInfo
        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
 {
@@ -357,6 +350,8 @@ 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;
@@ -366,6 +361,7 @@ typedef struct _procLangInfo
        DumpableObject dobj;
        bool            lanpltrusted;
        Oid                     lanplcallfoid;
+       Oid                     laninline;
        Oid                     lanvalidator;
        char       *lanacl;
        char       *lanowner;           /* name of owner, or empty string */
@@ -424,7 +420,7 @@ typedef struct _fdwInfo
 {
        DumpableObject dobj;
        char       *rolname;
-       char       *fdwlibrary;
+       char       *fdwvalidator;
        char       *fdwoptions;
        char       *fdwacl;
 } FdwInfo;
@@ -440,6 +436,21 @@ typedef struct _foreignServerInfo
        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 */
@@ -524,5 +535,6 @@ extern TSTemplateInfo *getTSTemplates(int *numTSTemplates);
 extern TSConfigInfo *getTSConfigurations(int *numTSConfigs);
 extern FdwInfo *getForeignDataWrappers(int *numForeignDataWrappers);
 extern ForeignServerInfo *getForeignServers(int *numForeignServers);
+extern DefaultACLInfo *getDefaultACLs(int *numDefaultACLs);
 
 #endif   /* PG_DUMP_H */