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 1lLyMV-00023v-Ec for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Mar 2021 01:19:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lLyMU-0003Pn-3U for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Mar 2021 01:19:06 +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 1lLyMT-0003Pg-PH for pgsql-hackers@lists.postgresql.org; Tue, 16 Mar 2021 01:19:05 +0000 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lLyMQ-00040C-Id for pgsql-hackers@postgresql.org; Tue, 16 Mar 2021 01:19:05 +0000 Received: by mail-il1-x136.google.com with SMTP id s1so11168874ilh.12 for ; Mon, 15 Mar 2021 18:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JoglGIkWliTLheHjqcUaIQjkxsXSpqSs17Ous4c1U2s=; b=aAOaUgLkbBFCt1FMkOoECl21PXTgVl1HhsE0Qpp6jkjFfAvs0D2i2Z6+asF+hqjzRD Fa+w5M9MipOGiIL6IrYIsz58D2WjaDqTr3bXLv09qwMcpKrMyT/RC42PMrGFD9aui3gu asZ+fDB5kIjb4vVvd7VuKWX3QeMhQrgpWUidWib9XHsVXlinuBIX804VeZ+UgiYesODF 1PrnETp/pFcJYMmWb+Ic6bK4TTxYsAz2nLJjrEOFl9cJ3Ajoe2VR1D3mBJhohQGhPYUW b6is7Xbm9f3xNOp5DqA7nCSAM11bzwf0T4xtsWtZAMNlM3fHHQVySOmNY9/jsvjJAoCr IpOQ== 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:user-agent; bh=JoglGIkWliTLheHjqcUaIQjkxsXSpqSs17Ous4c1U2s=; b=eXYBC5PVcKG+wneQBbQVi6nLiO3D5vKPruK3aOvUsXRXZu7vt3hRFm5IN8Uhnsg61Q PySxYc+AO2jkxfTc9A4ri9lVAmvkLRRgsLAmvCK175ZrtcVTVXYPdoMNz4XNRXZeoTl3 S7X5J8kPLDLE4RiAplJy0PYQglS0bX1y8VJmXqJmEQnbFJcQgvY2Eq1fZWS/XrTqRv0k gLErnMAb0WQTfT2RJ0Jz2+1WDF03WaKs7Ffz8Nj4WxOkpvjxSbkvlB4nlLdr2NvXFW4P HQV2UErnEXer6IoLMdp97U4/QS+kjNHhp+F7EkJn42ddAkiU8+En3XPOVWDA6oTWO7ju S/gw== X-Gm-Message-State: AOAM53190ZGh4D09AKmrHCDdRMAiT93iDS2r0D+YaZY/W6xN9EVBOwak n4XVrMRvwSxiKu9sJciFpFMrnA== X-Google-Smtp-Source: ABdhPJzl3mPG41eltVCAkWVaJWLOLYQ0V/kCCDaeK6YP+SbLzsneycifEbuGVbedfW1bw7klMXRUaw== X-Received: by 2002:a92:7007:: with SMTP id l7mr1759732ilc.187.1615857541033; Mon, 15 Mar 2021 18:19:01 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a16sm8674340ild.82.2021.03.15.18.19.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Mar 2021 18:19:00 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 7CD3C8007F8; Mon, 15 Mar 2021 20:18:59 -0500 (CDT) Date: Mon, 15 Mar 2021 20:18:59 -0500 From: Justin Pryzby To: Tom Lane Cc: Alvaro Herrera , Alexey Bashtanov , Franck Verrot , pgsql-hackers@postgresql.org Subject: Re: [PATCH]: Allow errors in parameter values to be reported during the BIND phase itself.. Message-ID: <20210316011859.GC29463@telsasoft.com> References: <20210104170939.GH9712@telsasoft.com> <3087634.1615848349@sss.pgh.pa.us> <20210315224945.GB29463@telsasoft.com> <3140512.1615854618@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3140512.1615854618@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 15, 2021 at 08:30:18PM -0400, Tom Lane wrote: > + /* Pop the error callback */ > + error_context_stack = error_context_stack->previous; > + > /* > * Once all parameters have been received, prepare for printing them > * in errors, if configured to do so. (This is saved in the portal, > * so that they'll appear when the query is executed later.) > */ > if (log_parameter_max_length_on_error != 0) > params->paramValuesStr = > BuildParamLogString(params, ... I think it's somewhat confusing that there's two callbacks. The first one applies only during typinput/typreceive. I guess the 2nd one should say that they're printed "in *future errors". > +# Check that errors are reported during BIND phase, too Actually, the v13 log_parameter_max_length_on_error feature works during BIND too, but only after typinput of *all* params. For example, this shows params when failing in GetCachedPlan(). | python3.5 -c "import pg,time; db=pg.DB('dbname=postgres host=/var/run/postgresql port=5432 host=/tmp'); q = db.query(\"SET backtrace_functions=pg_strtoint16; SET log_parameter_max_length_on_error=-1;\"); db.prepare('p', 'SELECT a::smallint from (select \$1 a)a'); db.query_prepared('p',66666);" So my own description of the patch evolved from "show errors during BIND" to "show errors during typinput of text params". Thanks, -- Justin