aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_dump.h
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2016-04-06 21:45:32 -0400
committerStephen Frost <sfrost@snowman.net>2016-04-06 21:45:32 -0400
commita9f0e8e5a2e779a888988cb64479a6723f668c84 (patch)
tree57c95fade4dfa8358865aa43aecf5a66ecad9a16 /src/bin/pg_dump/pg_dump.h
parent6c268df1276e9dd73e4d2cc89cf8787e8f186bda (diff)
downloadpostgresql-a9f0e8e5a2e779a888988cb64479a6723f668c84.tar.gz
postgresql-a9f0e8e5a2e779a888988cb64479a6723f668c84.zip
In pg_dump, use a bitmap to represent what to include
pg_dump has historically used a simple boolean 'dump' value to indicate if a given object should be included in the dump or not. Instead, use a bitmap which breaks down the components of an object into their distinct pieces and use that bitmap to only include the components requested. This does not include any behavioral change, but is in preperation for the change to dump out just ACLs for objects in pg_catalog. Reviews by Alexander Korotkov, Jose Luis Tallon
Diffstat (limited to 'src/bin/pg_dump/pg_dump.h')
-rw-r--r--src/bin/pg_dump/pg_dump.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index c02c536a9c4..f479c06d26c 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -81,6 +81,18 @@ typedef enum
DO_POLICY
} DumpableObjectType;
+/* component types of an object which can be selected for dumping */
+typedef uint32 DumpComponents; /* a bitmask of dump object components */
+#define DUMP_COMPONENT_NONE (0)
+#define DUMP_COMPONENT_DEFINITION (1 << 0)
+#define DUMP_COMPONENT_DATA (1 << 1)
+#define DUMP_COMPONENT_COMMENT (1 << 2)
+#define DUMP_COMPONENT_SECLABEL (1 << 3)
+#define DUMP_COMPONENT_ACL (1 << 4)
+#define DUMP_COMPONENT_POLICY (1 << 5)
+#define DUMP_COMPONENT_USERMAP (1 << 6)
+#define DUMP_COMPONENT_ALL (0xFFFF)
+
typedef struct _dumpableObject
{
DumpableObjectType objType;
@@ -88,7 +100,7 @@ typedef struct _dumpableObject
DumpId dumpId; /* assigned by AssignDumpId() */
char *name; /* object name (should never be NULL) */
struct _namespaceInfo *namespace; /* containing namespace, or NULL */
- bool dump; /* true if we want to dump this object */
+ DumpComponents dump; /* bitmask of components to dump */
bool ext_member; /* true if object is member of extension */
DumpId *dependencies; /* dumpIds of objects this one depends on */
int nDeps; /* number of valid dependencies */