Commit a87a7dc8 authored by Heikki Linnakangas's avatar Heikki Linnakangas

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.
parent c922353b
...@@ -564,8 +564,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId) ...@@ -564,8 +564,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId)
descriptor = BuildDescForRelation(schema); descriptor = BuildDescForRelation(schema);
localHasOids = interpretOidsOption(stmt->options, localHasOids = interpretOidsOption(stmt->options,
(relkind == RELKIND_RELATION || (relkind == RELKIND_RELATION));
relkind == RELKIND_FOREIGN_TABLE));
descriptor->tdhasoid = (localHasOids || parentOidCount > 0); descriptor->tdhasoid = (localHasOids || parentOidCount > 0);
/* /*
......
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