1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-15 14:02:29 +03:00

Fix problems with incomplete attempt to prohibit OIDS with MVs.

Problem with assertion failure in restoring from pg_dump output
reported by Joachim Wieland.

Review and suggestions by Tom Lane and Robert Haas.
This commit is contained in:
Kevin Grittner
2013-03-22 13:27:34 -05:00
parent 4912385b56
commit 549dae0352
6 changed files with 32 additions and 6 deletions

View File

@@ -218,11 +218,15 @@ GetIntoRelEFlags(IntoClause *intoClause)
* because it doesn't have enough information to do so itself (since we
* can't build the target relation until after ExecutorStart).
*/
if (interpretOidsOption(intoClause->options))
if (interpretOidsOption(intoClause->options, intoClause->relkind))
flags = EXEC_FLAG_WITH_OIDS;
else
flags = EXEC_FLAG_WITHOUT_OIDS;
Assert(intoClause->relkind != RELKIND_MATVIEW ||
(flags & (EXEC_FLAG_WITH_OIDS | EXEC_FLAG_WITHOUT_OIDS)) ==
EXEC_FLAG_WITHOUT_OIDS);
if (intoClause->skipData)
flags |= EXEC_FLAG_WITH_NO_DATA;