Re: REINDEX CONCURRENTLY unexpectedly fails - Mailing list pgsql-bugs

From Tom Lane
Subject Re: REINDEX CONCURRENTLY unexpectedly fails
Date
Msg-id 12383.1573660748@sss.pgh.pa.us
Whole thread Raw
In response to Re: REINDEX CONCURRENTLY unexpectedly fails  (Andres Freund <andres@anarazel.de>)
Responses Re: REINDEX CONCURRENTLY unexpectedly fails  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> On 2019-11-13 15:29:53 +0100, Manuel Rigger wrote:
>> On the latest trunk version, I get an error "index "t0_pkey_ccnew"
>> already contains data" when using REINDEX CONCURRENTLY:
>> 
>> CREATE TEMP TABLE t0(c1 INT PRIMARY KEY) ON COMMIT DELETE ROWS;
>> REINDEX TABLE CONCURRENTLY t0; -- unexpected: ERROR:  index
>> "t0_pkey_ccnew" already contains data

> It think we really ought to just refuse CIC (and thereby REINDEX
> CONCURRENTLY) for ON COMMIT DELETE/DROP temp tables. Given that CIC
> internally uses transactions, it makes no sense to use CIC on such a
> table.

It's not real clear why there would be any point in (RE)INDEX
CONCURRENTLY on a temp table anyway, since no other session could
be using it.  +1 for just erroring out, rather than working
hard to support such a case.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: REINDEX CONCURRENTLY unexpectedly fails
Next
From: Manuel Rigger
Date:
Subject: Unexpected "cache lookup failed for collation 0" failure