Skip to content

Commit 6178f3c

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 b59d4d6 commit 6178f3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/pg_dump/pg_backup_archiver.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ struct _archiveHandle
347347
char *currUser; /* current username, or NULL if unknown */
348348
char *currSchema; /* current schema, or NULL */
349349
char *currTablespace; /* current tablespace, or NULL */
350-
bool currWithOids; /* current default_with_oids setting */
350+
char currWithOids; /* current default_with_oids setting: true,
351+
* false, or -1 for unknown, forcing a SET */
351352

352353
void *lo_buf;
353354
size_t lo_buf_used;

0 commit comments

Comments
 (0)