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 1gjTfy-0000tg-5r for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Jan 2019 18:43:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjTfw-0005YN-Op for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Jan 2019 18:43:00 +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 1gjTfw-0005YG-Ij for pgsql-bugs@lists.postgresql.org; Tue, 15 Jan 2019 18:43:00 +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 1gjTfu-0003PB-Ji for pgsql-bugs@lists.postgresql.org; Tue, 15 Jan 2019 18:43:00 +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 x0FIguJS002817; Tue, 15 Jan 2019 13:42:56 -0500 From: Tom Lane To: Alvaro Herrera cc: Jesper Pedersen , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT In-reply-to: <201901151824.mxkelqcnfeq6@alvherre.pgsql> References: <201901151824.mxkelqcnfeq6@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 15 Jan 2019 15:24:57 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2814.1547577776.1@sss.pgh.pa.us> Date: Tue, 15 Jan 2019 13:42:56 -0500 Message-ID: <2815.1547577776@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2019-Jan-10, Jesper Pedersen wrote: >> However, when you use ADD CONSTRAINT FOREIGN KEY you can't use ONLY, so >> would it be a good idea to make ADD CONSTRAINT UNIQUE behave the same way, >> i.e. error out ? > I haven't investigated this angle. It seems more complex than just a > simple bugfix, right? Wouldn't that be throwing away the entire point of the ONLY behavior, ie to allow the component indexes to be built one at a time, without holding locks across the whole partition tree? I'm having a hard time getting from "ONLY confuses me" to "nobody should be allowed to do this". I think there is a documentation and UX issue here, but I don't see that there's anything wrong with the functionality. regards, tom lane