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 1m3jDC-0007pf-Nx for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 18:02:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3jDB-0004Hv-Mu for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 18:02:21 +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 1m3jDB-0004Fu-F0 for pgsql-hackers@lists.postgresql.org; Wed, 14 Jul 2021 18:02:21 +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 1m3jD9-0007Ub-Gw for pgsql-hackers@lists.postgresql.org; Wed, 14 Jul 2021 18:02:20 +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 16EI2IH63521850; Wed, 14 Jul 2021 14:02:18 -0400 From: Tom Lane To: Julien Rouhaud cc: pgsql-hackers@lists.postgresql.org Subject: Re: [HACKERS] Preserving param location In-reply-to: <20210714094645.moaxeqokvnemr2zj@nol> References: <20170311220932.GJ15188@nol.local> <20210627033153.4orlkah2grcnslgi@nol> <20210627033539.53gfcixzd3u5yl4j@nol> <3441862.1626217284@sss.pgh.pa.us> <20210714094645.moaxeqokvnemr2zj@nol> Comments: In-reply-to Julien Rouhaud message dated "Wed, 14 Jul 2021 17:46:45 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3521848.1626285738.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 14 Jul 2021 14:02:18 -0400 Message-ID: <3521849.1626285738@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Julien Rouhaud writes: > On Tue, Jul 13, 2021 at 07:01:24PM -0400, Tom Lane wrote: >> So I'm not really convinced that there's a fully-baked use case >> here, and would like more detail about how you hope to use the >> location value. > As I said I have no doubt that there are other cases which are currently= not > correctly handled, but that's not what I'm trying to fix. I just want t= o treat > parameterized queries the same way as regular queries, thus fixing one o= bvious > and frequent case (for which some user did complain), hoping that it wil= l on > its own already help many users. Hm. I guess this point (i.e. that the Param substitution should result in the identical plan tree as writing a literal constant would have) has some force. I still feel like your application is pretty shaky, but I don't really have any ideas about feasible ways to make it better. Will push the patch. regards, tom lane