diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2018-11-09 09:17:25 +0100 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-11-13 09:41:34 +0100 |
commit | b72b4fafb962c5cc1c3d2311b2971a299497202b (patch) | |
tree | 331869101f56a2647087ffdb6119fa68d83e6e6e /src | |
parent | f43e679b533cab0f26adbca8d54585b94889ce80 (diff) | |
download | postgresql-b72b4fafb962c5cc1c3d2311b2971a299497202b.tar.gz postgresql-b72b4fafb962c5cc1c3d2311b2971a299497202b.zip |
pg_dump: Fix dumping of WITH OIDS tables
A table with OIDs that was the first in the dump output would not get
dumped with OIDs enabled. Fix that.
The reason was that the currWithOids flag was declared to be bool but
actually also takes a -1 value for "don't know yet". But under
stdbool.h semantics, that is coerced to true, so the required SET
default_with_oids command is not output again. Change the variable
type to char to fix that.
Reported-by: Derek Nelson <derek@pipelinedb.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index 8dd19159989..7d533666352 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -346,7 +346,8 @@ struct _archiveHandle char *currUser; /* current username, or NULL if unknown */ char *currSchema; /* current schema, or NULL */ char *currTablespace; /* current tablespace, or NULL */ - bool currWithOids; /* current default_with_oids setting */ + char currWithOids; /* current default_with_oids setting: true, + * false, or -1 for unknown, forcing a SET */ void *lo_buf; size_t lo_buf_used; |