Comment 9 for bug 1815665

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Call:
-- This will fail. Silence the message as it's different across PG versions.
SET client_min_messages = fatal;
CREATE UNIQUE INDEX CONCURRENTLY idx_badindex_n ON tbl_badindex (n);

Error:
ERROR: could not create unique index "idx_badindex_n"
DETAIL: Key (n)=(10) is duplicated.

So the failure is an expected error, but now having different/more "output"?

Test can be re-run - Re-execution via:
$ cd /tmp/autopkgtest.BTTHR0/build.p5M/src/
$ sudo rm -rf /tmp/pg-repack-tablespace; mkdir /tmp/pg-repack-tablespace; LC_ALL=C.UTF-8 pg_buildext -i'--auth=trust' installcheck-10

Modify the failing testcase in regress/sql/repack.sql
Stop silencing the message in the good autopkgtest (before 10.7) to check if the errors are the same.

As expected adding this to the expected output fixes the issue.
--- src/regress/expected/repack_3.out.old 2019-02-13 10:57:21.436486225 +0100
+++ src/regress/expected/repack_3.out.new 2019-02-13 10:57:11.264461520 +0100
@@ -127,6 +127,8 @@
 -- This will fail. Silence the message as it's different across PG versions.
 SET client_min_messages = fatal;
 CREATE UNIQUE INDEX CONCURRENTLY idx_badindex_n ON tbl_badindex (n);
+ERROR: could not create unique index "idx_badindex_n"
+DETAIL: Key (n)=(10) is duplicated.
 SET client_min_messages = warning;
 INSERT INTO tbl_idxopts VALUES (0, 'abc'), (1, 'aaa'), (2, NULL), (3, 'bbb');
 -- Insert no-ordered data

We need to make sure what the old error was, either the silencing dosn't work and more or the error is now considered more severe.

Disabling
 SET client_min_messages = fatal;
in the good run gives these messages:
  + ERROR: could not create unique index "idx_badindex_n"
  + DETAIL: Key (n)=(10) is duplicated.

Ok, those are -exactly- the same - so the message silencing is affected by the update.
That means the actual error is totally fine, but why did the message pop up.
Checking through the REL_10_STABLE branch ...