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 1jHVdg-0002C7-0S for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 16:45:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHVde-0004lY-Pj for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 16:45:50 +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 1jHVde-0004lR-Dd for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2020 16:45:50 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jHVdc-0004FK-2l for pgsql-hackers@postgresql.org; Thu, 26 Mar 2020 16:45:49 +0000 Received: by mail-lj1-x241.google.com with SMTP id i20so7120305ljn.6 for ; Thu, 26 Mar 2020 09:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+T2NLWnKc6v02Bx2EpsLzA18VoanGebebItOYoYNfS0=; b=JorKHLaujadaKqD6CRBBtfX7xnqrm/x4AYbfQjskJ/2e5sSF967K+/wWtjxEBC9QO2 uSHn6+Q3xd4M4dzV5qqSYGBKgWtgJY8uYOqk99WZ9t608+NHQk2CLYRC/9r8JfuEDfEq BMHfoww4QCXHOs1CMyEAIlUyVnaGsnoe6FpI8stYXqtqPqphrixSZeiiAkMH6xQgOSuT 3WSr4pttNbZsZoUIhLQSoGWKE1rLd07P4e2br3mVr+tR7Ro4TZP4rvYZCgbejct4GrHz oMgXRAoLQ7G9Zu7FpyLFW/ZHkgDUOCYp1PUSQuZiJBwaO2mbFv5gpkeYfNcgE1LapBWf 33Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+T2NLWnKc6v02Bx2EpsLzA18VoanGebebItOYoYNfS0=; b=KX5Uuk1Ze1C2acL3Td7bpVymQDfQNVKETBn2QU1rFvsrqSO5PlG/ZcQLXmLCIvNaoa GHBuwO/KmQ9gbZ0E2hXmjITVU5G5xChsWFeQa9bOPkUvg+3pyfGyuAaCuU4Y4nQLQhMO J/VlbNILZUO1a4UHnKpX1VgqUFTAZknEYCrNuq3Xqy8eztodwhetZsb8bzsXUEzNuFkW +0DzMw2J1WNtF8DPrZveYiCFwe/vMSju5FhAFEjhpAyUfwinK8L8bqooM3Wmcq9VfsLD 0fMTIjzAOMu1HkzS3xyydLZDIxkGchYT8IbDNsxt4b1CvNpjKIPfmewqws9ghMmcP48p dk1A== X-Gm-Message-State: AGi0PubZfE3VU2QksEBk1bXjKNo12wxHbyXz8iiy23XpYMpjIThMblAo alv/bcnksDEn+R2fNN4dh0c= X-Google-Smtp-Source: APiQypJ2VCH32KA939OMfObGL1WNuTnNJ0EX7psHmFg5zvWxTlXL7qYhN8k/5PobTRP/KHgv4/Mzaw== X-Received: by 2002:a2e:9ed6:: with SMTP id h22mr6043979ljk.211.1585241146508; Thu, 26 Mar 2020 09:45:46 -0700 (PDT) Received: from nol (82-64-124-11.subs.proxad.net. [82.64.124.11]) by smtp.gmail.com with ESMTPSA id v10sm1905478lfb.61.2020.03.26.09.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 09:45:45 -0700 (PDT) Date: Thu, 26 Mar 2020 17:45:41 +0100 From: Julien Rouhaud To: Tom Lane Cc: Fujii Masao , legrand legrand , pgsql-hackers@postgresql.org Subject: Re: Patch: to pass query string to pg_plan_query() Message-ID: <20200326164541.GD80836@nol> References: <1583789487074-0.post@n3.nabble.com> <6ecbaaca-5a8e-5fe6-f7e1-a893e708bd7b@oss.nttdata.com> <14854.1585237484@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14854.1585237484@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Mar 26, 2020 at 11:44:44AM -0400, Tom Lane wrote: > 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. Surprinsingly, the whole regression tests pass flawlessly with an non-null query string assert, but we did had some discussion about it. The pending IVM patch would break that assumption, same as some non trivial extensions like citus (see https://www.postgresql.org/message-id/flat/CAFMSG9HJQr%3DH8doWJOp%3DwqyKbVqxMLkk_Qu2KfpmkKvS-Xn7qQ%40mail.gmail.com#ab8ea541b8c8464f7b52ba6d8d480b7d and later), so we didn't make it a hard requirement.