Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b72b4fa

Browse files
committed
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>
1 parent f43e679 commit b72b4fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/pg_dump/pg_backup_archiver.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ struct _archiveHandle
346346
char *currUser; /* current username, or NULL if unknown */
347347
char *currSchema; /* current schema, or NULL */
348348
char *currTablespace; /* current tablespace, or NULL */
349-
bool currWithOids; /* current default_with_oids setting */
349+
char currWithOids; /* current default_with_oids setting: true,
350+
* false, or -1 for unknown, forcing a SET */
350351

351352
void *lo_buf;
352353
size_t lo_buf_used;

0 commit comments

Comments
 (0)