pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Alexey Bashtanov <bashtanov@imap.cc>
Cc: Franck Verrot <franck@verrot.fr>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PATCH]: Allow errors in parameter values to be reported during the BIND phase itself..
Date: Mon, 15 Mar 2021 18:45:49 -0400
Message-ID: <3087634.1615848349@sss.pgh.pa.us> (raw)
In-Reply-To: <20210104170939.GH9712@telsasoft.com>
References: <20210104170939.GH9712@telsasoft.com>

Justin Pryzby <pryzby@telsasoft.com> writes:
> For example:
> $ python3.5 -c "import pg; db=pg.DB(); q = db.query(\"SET log_parameter_max_length_on_error=-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 range for type smallint
> 2021-01-03 02:21:04.547 CST [20157] CONTEXT:  unnamed portal with parameters: $1 = '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 is out
> of range.  Think 900 int/smallint columns, or less-wide tables being inserted
> multiple rows at a time with VALUES(),(),()...

> Of course, this isn't as good as showing the column name, so I might pursue
> 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





view thread (9+ messages)  latest in thread

Message-ID: <3087634.1615848349@sss.pgh.pa.us>
Permalink:  ../3087634.1615848349@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3087634.1615848349@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pryzby@telsasoft.com, alvherre@alvh.no-ip.org, bashtanov@imap.cc, franck@verrot.fr
  Subject: Re: [PATCH]: Allow errors in parameter values to be reported during the BIND phase itself..
  In-Reply-To: <3087634.1615848349@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox