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 1hW6UX-0004P8-6b for pgsql-hackers@arkaria.postgresql.org; Wed, 29 May 2019 21:52:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hW6UV-0004Nl-SC for pgsql-hackers@arkaria.postgresql.org; Wed, 29 May 2019 21:52:11 +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 1hW6UV-0004Ne-Iz for pgsql-hackers@lists.postgresql.org; Wed, 29 May 2019 21:52:11 +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 1hW6UR-0006UN-Qm for pgsql-hackers@lists.postgresql.org; Wed, 29 May 2019 21:52:11 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x4TLq3Ml018037; Wed, 29 May 2019 17:52:03 -0400 From: Tom Lane To: Robert Haas cc: PostgreSQL Hackers Subject: Re: Rearranging ALTER TABLE to avoid multi-operations bugs In-reply-to: References: <10365.1558909428@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 29 May 2019 16:50:49 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <41499.1559166722.1@sss.pgh.pa.us> Date: Wed, 29 May 2019 17:52:02 -0400 Message-ID: <41500.1559166722@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Sun, May 26, 2019 at 6:24 PM Tom Lane wrote: >> Anybody have thoughts about a different way to approach it? > I mean, in an ideal world, I think we'd never call back out to > ProcessUtility() from within AlterTable(). That seems like a pretty > clear layering violation. I assume the reason we've never tried to do > better is a lack of round tuits and/or sufficient motivation. > In terms of what we'd do instead, I suppose we'd try to move as much > as possible inside the ALTER TABLE framework proper and have > everything call into that. Hm ... I'm not exactly clear on why that would be a superior solution. It would imply that standalone CREATE INDEX etc would call into the ALTER TABLE framework --- how is that not equally a layering violation? Also, recursive ProcessUtility cases exist independently of this issue, in particular in CreateSchemaCommand. My worry about my patch upthread is not really that it introduces another one, but that it doesn't do anything towards providing a uniform framework/notation for all these cases. regards, tom lane