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 1lxWUC-0000Yw-2l for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Jun 2021 15:14: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 1lxWU9-0003Jf-Lo for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Jun 2021 15:14:13 +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 1lxWU9-0003JW-DX for pgsql-hackers@lists.postgresql.org; Sun, 27 Jun 2021 15:14:13 +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 1lxWU4-0002Pn-9e for pgsql-hackers@lists.postgresql.org; Sun, 27 Jun 2021 15:14:12 +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 15RFE5F2008086; Sun, 27 Jun 2021 11:14:05 -0400 From: Tom Lane To: Julien Rouhaud cc: pgsql-hackers@lists.postgresql.org Subject: Re: Deparsing rewritten query In-reply-to: <20210627150343.zslwnw7g564f2zz4@nol> References: <20210627041138.zklczwmu3ms4ufnk@nol> <3176554.1624804492@sss.pgh.pa.us> <20210627150343.zslwnw7g564f2zz4@nol> Comments: In-reply-to Julien Rouhaud message dated "Sun, 27 Jun 2021 23:03:43 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8084.1624806845.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 27 Jun 2021 11:14:05 -0400 Message-ID: <8085.1624806845@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Julien Rouhaud writes: > On Sun, Jun 27, 2021 at 10:34:52AM -0400, Tom Lane wrote: >> It's not very hard to imagine someday moving view >> expansion into the planner on efficiency grounds, leaving the rewriter >> handling only the rare uses of INSERT/UPDATE/DELETE rules. > Agreed. One the other hand having such a function in core may ensure th= at any > significant change in those area will keep an API to retrieve the final = query > representation. My point is precisely that I'm unwilling to make such a promise. I do not buy that this capability is worth very much, given that we've gotten along fine without it for twenty-plus years. If you want to have it as an internal, might-change-at-any-time API, that seems all right. If you're trying to lock it down as something that will be there forevermore, you're likely to end up with nothing. regards, tom lane