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.92) (envelope-from ) id 1jHUgg-0008Oj-Mq for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 15:44:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHUgf-0001mZ-Ga for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 15:44:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHUgf-0001mR-4C for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2020 15:44:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHUgc-0003ld-Rj for pgsql-hackers@postgresql.org; Thu, 26 Mar 2020 15:44:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 02QFiitx014855; Thu, 26 Mar 2020 11:44:44 -0400 From: Tom Lane To: Fujii Masao cc: legrand legrand , pgsql-hackers@postgresql.org Subject: Re: Patch: to pass query string to pg_plan_query() In-reply-to: <6ecbaaca-5a8e-5fe6-f7e1-a893e708bd7b@oss.nttdata.com> References: <1583789487074-0.post@n3.nabble.com> <6ecbaaca-5a8e-5fe6-f7e1-a893e708bd7b@oss.nttdata.com> Comments: In-reply-to Fujii Masao message dated "Thu, 26 Mar 2020 22:54:35 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14853.1585237484.1@sss.pgh.pa.us> Date: Thu, 26 Mar 2020 11:44:44 -0400 Message-ID: <14854.1585237484@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fujii Masao writes: > Does anyone object to this patch? I'm thinking to commit it separetely > at first before committing the planning_counter_in_pg_stat_statements > patch. I took a quick look through v9-0001-Pass-query-string-to-the-planner.patch and it's fine by me. It also matches up with something I've wanted to do for awhile, which is to make the query string available during planning and execution so that we can produce error cursors for run-time errors, when relevant. (It's a little weird that the patch doesn't make standard_planner actually *do* anything with the string, like say save it into the PlannerInfo struct. But that can come later I guess.) Note that I wouldn't want to bet that all of these call sites always have non-null query strings to pass; but probably most of the time they will. regards, tom lane