Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUv3B-00033A-6p for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Nov 2019 15:59:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iUv39-0004QY-Ff for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Nov 2019 15:59:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUv39-0004QR-8B for pgsql-bugs@lists.postgresql.org; Wed, 13 Nov 2019 15:59:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUv35-00075n-Lv for pgsql-bugs@lists.postgresql.org; Wed, 13 Nov 2019 15:59:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xADFx8eq012384; Wed, 13 Nov 2019 10:59:08 -0500 From: Tom Lane To: Andres Freund cc: Manuel Rigger , PostgreSQL mailing lists Subject: Re: REINDEX CONCURRENTLY unexpectedly fails In-reply-to: <20191113154837.mgz2rnl6d7k6tas7@alap3.anarazel.de> References: <20191113154837.mgz2rnl6d7k6tas7@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 13 Nov 2019 07:48:37 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12382.1573660748.1@sss.pgh.pa.us> Date: Wed, 13 Nov 2019 10:59:08 -0500 Message-ID: <12383.1573660748@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund 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