Skip to content

Commit dd1a5b0

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 cbc0517 commit dd1a5b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/commands/tablecmds.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId)
517517
*/
518518
descriptor = BuildDescForRelation(schema);
519519

520-
localHasOids = interpretOidsOption(stmt->options);
520+
if (relkind == RELKIND_FOREIGN_TABLE)
521+
localHasOids = false;
522+
else
523+
localHasOids = interpretOidsOption(stmt->options);
521524
descriptor->tdhasoid = (localHasOids || parentOidCount > 0);
522525

523526
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy