Skip to content

Commit 2a7512b

Browse files
committed
Don't allow foreign tables with OIDs.
The syntax doesn't let you specify "WITH OIDS" for foreign tables, but it was still possible with default_with_oids=true. But the rest of the system, including pg_dump, isn't prepared to handle foreign tables with OIDs properly. Backpatch down to 9.1, where foreign tables were introduced. It's possible that there are databases out there that already have foreign tables with OIDs. There isn't much we can do about that, but at least we can prevent them from being created in the future. Patch by Etsuro Fujita, reviewed by Hadi Moshayedi.
1 parent 33b0548 commit 2a7512b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId)
561561
descriptor = BuildDescForRelation(schema);
562562

563563
localHasOids = interpretOidsOption(stmt->options,
564-
(relkind == RELKIND_RELATION ||
565-
relkind == RELKIND_FOREIGN_TABLE));
564+
(relkind == RELKIND_RELATION));
566565
descriptor->tdhasoid = (localHasOids || parentOidCount > 0);
567566

568567
/*

0 commit comments

Comments
 (0)