From: Tom Lane <tgl@sss.pgh.pa.us>
To: Manuel Rigger <rigger.manuel@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: REINDEX CONCURRENTLY causes ALTER TABLE to fail
Date: Sat, 20 Jul 2019 23:19:12 -0400
Message-ID: <7779.1563679152@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+u7OA5Hp0ra235F3czPom_FyAd-3+XwSJmX95r1+sRPOJc9VQ@mail.gmail.com>
References: <CA+u7OA5Hp0ra235F3czPom_FyAd-3+XwSJmX95r1+sRPOJc9VQ@mail.gmail.com>
Manuel Rigger <rigger.manuel@gmail.com> writes:
> Consider the following statement sequence:
> CREATE TABLE t0(c0 INTEGER , c1 BOOLEAN);
> INSERT INTO t0(c0, c1) VALUES(1369652450, FALSE), (414515746, TRUE),
> (897778963, FALSE);
> CREATE UNIQUE INDEX i0 ON t0((1 / t0.c0)) WHERE ('-H') >=
> (t0.c1::TEXT) COLLATE "C";
> REINDEX TABLE CONCURRENTLY t0;
> ALTER TABLE t0 ALTER c1 TYPE TEXT; -- could not create unique index
> "i0" DETAIL: Key ((1 / c0))=(0) is duplicated.
> The REINDEX TABLE CONCURRENTLY causes the ALTER TABLE to fail, which
> is unexpected.
BTW, a note for anybody trying to follow along at home --- this example
does not reproduce if the database's default collation is "C".
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rigger.manuel@gmail.com
Subject: Re: REINDEX CONCURRENTLY causes ALTER TABLE to fail
In-Reply-To: <7779.1563679152@sss.pgh.pa.us>
References: <CA+u7OA5Hp0ra235F3czPom_FyAd-3+XwSJmX95r1+sRPOJc9VQ@mail.gmail.com> <7779.1563679152@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox