Commit 6178f3cb authored by Peter Eisentraut's avatar Peter Eisentraut

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: default avatarDerek Nelson <derek@pipelinedb.com>
parent b59d4d6c
...@@ -347,7 +347,8 @@ struct _archiveHandle ...@@ -347,7 +347,8 @@ struct _archiveHandle
char *currUser; /* current username, or NULL if unknown */ char *currUser; /* current username, or NULL if unknown */
char *currSchema; /* current schema, or NULL */ char *currSchema; /* current schema, or NULL */
char *currTablespace; /* current tablespace, 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; void *lo_buf;
size_t lo_buf_used; size_t lo_buf_used;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment