Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5bAR-0002fe-DP for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Dec 2022 23:28:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5bAQ-00017a-4i for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Dec 2022 23:28:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5bAP-00017Q-TL for pgsql-bugs@lists.postgresql.org; Wed, 14 Dec 2022 23:28:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5bAN-0006f0-Ru for pgsql-bugs@lists.postgresql.org; Wed, 14 Dec 2022 23:28:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2BENRqfY3039078; Wed, 14 Dec 2022 18:27:52 -0500 From: Tom Lane To: Daniel Gustafsson cc: Peter Eisentraut , "David G. Johnston" , "zedaardv@drizzle.com" , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #17720: pg_dump creates a dump with primary key that cannot be restored, when specifying 'using index ...' In-reply-to: <20CD10FD-A9C2-47D0-9A75-B86532BC058E@yesql.se> References: <17720-dab8ee0fa85d316d@postgresql.org> <9C039DE3-EFBD-4D65-B4CF-90D8148B7B4C@yesql.se> <2684951.1671032222@sss.pgh.pa.us> <20CD10FD-A9C2-47D0-9A75-B86532BC058E@yesql.se> Comments: In-reply-to Daniel Gustafsson message dated "Wed, 14 Dec 2022 23:30:54 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3039076.1671060472.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 14 Dec 2022 18:27:52 -0500 Message-ID: <3039077.1671060472@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > The attached prohibits the use of NULLS NOT DISTINCT for backing primary= key > constraints but allow them for unique constraints. Is this along the li= nes of > what you had in mind? Needs more than zero comments in the code, and why bother testing is_alter_table in index_check_primary_key? We're disallowing this case across-the-board, no matter how you get to it. I'll defer to Peter on whether this is in fact the right way to go, or we should relax the syntax restriction as David suggests. regards, tom lane