aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-06-24 12:31:36 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-06-24 13:31:00 +0300
commit2a7512bc7fd01b311f967e85024fa695a6061e4f (patch)
treed8a857f78aa517e5bda84509d0341d00e64e609a
parent33b05485301f0f649fa30ba32c7b8b253f78ca8e (diff)
downloadpostgresql-2a7512bc7fd01b311f967e85024fa695a6061e4f.tar.gz
postgresql-2a7512bc7fd01b311f967e85024fa695a6061e4f.zip
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.
-rw-r--r--src/backend/commands/tablecmds.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 020f8a5d494..6392aee3f6a 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -561,8 +561,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId)
descriptor = BuildDescForRelation(schema);
localHasOids = interpretOidsOption(stmt->options,
- (relkind == RELKIND_RELATION ||
- relkind == RELKIND_FOREIGN_TABLE));
+ (relkind == RELKIND_RELATION));
descriptor->tdhasoid = (localHasOids || parentOidCount > 0);
/*