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 1ngYIC-0001Jf-Q3 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2022 20:48:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ngYIB-0002Iy-L1 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2022 20:48:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ngYIB-0002Hy-AX for pgsql-hackers@lists.postgresql.org; Mon, 18 Apr 2022 20:48:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ngYI5-0008HN-0p for pgsql-hackers@postgresql.org; Mon, 18 Apr 2022 20:48:14 +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 23IKm7BT2379841; Mon, 18 Apr 2022 16:48:07 -0400 From: Tom Lane To: "David G. Johnston" cc: Simon Riggs , PostgreSQL Hackers Subject: Re: Dump/Restore of non-default PKs In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Mon, 18 Apr 2022 13:20:52 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2379839.1650314887.1@sss.pgh.pa.us> Date: Mon, 18 Apr 2022 16:48:07 -0400 Message-ID: <2379840.1650314887@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Mon, Apr 18, 2022 at 1:00 PM Simon Riggs > wrote: >> I propose that we change pg_dump so that when it creates a PK it does >> so in 2 commands: >> 1. CREATE [UNIQUE] INDEX iname ... >> 2. ALTER TABLE .. ADD PRIMARY KEY USING INDEX iname; > Why not just get rid of the limitation that constraint definitions don't > support non-default methods? That approach would be doubling down on the assumption that we can always shoehorn more custom options into SQL-standard constraint clauses, and we'll never fall foul of shift/reduce problems or future spec additions. I think for example that USING INDEX TABLESPACE is a blot on humanity, and I'd be very glad to see pg_dump stop using it in favor of doing things as Simon suggests. regards, tom lane