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 1lLvyO-00041d-K4 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Mar 2021 22:46:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lLvyL-0001sp-L5 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Mar 2021 22:46:01 +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 1lLvyL-0001si-Cm for pgsql-hackers@lists.postgresql.org; Mon, 15 Mar 2021 22:46:01 +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 1lLvyE-0003K5-UA for pgsql-hackers@postgresql.org; Mon, 15 Mar 2021 22:46:00 +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 12FMjnP83087635; Mon, 15 Mar 2021 18:45:50 -0400 From: Tom Lane To: Justin Pryzby 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.. In-reply-to: <20210104170939.GH9712@telsasoft.com> References: <20210104170939.GH9712@telsasoft.com> Comments: In-reply-to Justin Pryzby message dated "Mon, 04 Jan 2021 11:09:39 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3087633.1615848349.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 15 Mar 2021 18:45:49 -0400 Message-ID: <3087634.1615848349@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Justin Pryzby writes: > For example: > $ python3.5 -c "import pg; db=3Dpg.DB(); q =3D db.query(\"SET log_parame= ter_max_length_on_error=3D-1;\"); db.prepare('p', 'SELECT \$1::smallint');= db.query_prepared('p',66666);" > 2021-01-03 02:21:04.547 CST [20157] ERROR: value "66666" is out of rang= e for type smallint > 2021-01-03 02:21:04.547 CST [20157] CONTEXT: unnamed portal with parame= ters: $1 =3D '66666' > 2021-01-03 02:21:04.547 CST [20157] STATEMENT: SELECT $1::smallint > When there are many bind params, this can be useful to determine which i= s out > of range. Think 900 int/smallint columns, or less-wide tables being ins= erted > multiple rows at a time with VALUES(),(),()... > Of course, this isn't as good as showing the column name, so I might pur= sue > Tom's suggestion for that at some point. I started to look at this, and immediately began to wonder where is the previous discussion you're evidently referring to. Can you dig up an archives link? regards, tom lane