summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorBruce Momjian2014-08-25 21:06:40 +0000
committerBruce Momjian2014-08-25 21:06:40 +0000
commit73d78e11a0f7183c80b93eefbbb6026fe9664015 (patch)
treedb5ab7b5c61f17586d03d7d601ad9c42b14ec238 /contrib
parentebe30ad59bb2d127f576be07e036a473999c4b80 (diff)
Throw error for ALTER TABLE RESET of an invalid option
Also adjust pg_upgrade to not use this method for optional TOAST table creation. Patch by Fabrízio de Royes Mello
Diffstat (limited to 'contrib')
-rw-r--r--contrib/pg_upgrade/dump.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/pg_upgrade/dump.c b/contrib/pg_upgrade/dump.c
index e623a226327..29a68c07a2d 100644
--- a/contrib/pg_upgrade/dump.c
+++ b/contrib/pg_upgrade/dump.c
@@ -115,6 +115,10 @@ optionally_create_toast_tables(void)
"c.relkind IN ('r', 'm') AND "
"c.reltoastrelid = 0");
+ /* Suppress NOTICE output from non-existant constraints */
+ PQclear(executeQueryOrDie(conn, "SET client_min_messages = warning;"));
+ PQclear(executeQueryOrDie(conn, "SET log_min_messages = warning;"));
+
ntups = PQntuples(res);
i_nspname = PQfnumber(res, "nspname");
i_relname = PQfnumber(res, "relname");
@@ -125,13 +129,16 @@ optionally_create_toast_tables(void)
OPTIONALLY_CREATE_TOAST_OID));
/* dummy command that also triggers check for required TOAST table */
- PQclear(executeQueryOrDie(conn, "ALTER TABLE %s.%s RESET (binary_upgrade_dummy_option);",
+ PQclear(executeQueryOrDie(conn, "ALTER TABLE %s.%s DROP CONSTRAINT IF EXISTS binary_upgrade_dummy_constraint;",
quote_identifier(PQgetvalue(res, rowno, i_nspname)),
quote_identifier(PQgetvalue(res, rowno, i_relname))));
}
PQclear(res);
+ PQclear(executeQueryOrDie(conn, "RESET client_min_messages;"));
+ PQclear(executeQueryOrDie(conn, "RESET log_min_messages;"));
+
PQfinish(conn);
}