pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Show ignored constants as "$N" rather than "?" in pg_stat_statem
Date: Tue, 28 Mar 2017 00:14:41 +0000
Message-ID: <E1csemX-0000xF-Sc@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Show ignored constants as "$N" rather than "?" in pg_stat_statements.

The trouble with the original choice here is that "?" is a valid (and
indeed used) operator name, so that you could end up with ambiguous
statement texts like "SELECT ? ? ?".  With this patch, you instead
see "SELECT $1 ? $2", which seems significantly more readable.
The numbers used for this purpose begin after the last actual $N parameter
in the particular query.  The conflict with external parameters has its own
potential for confusion of course, but it was agreed to be an improvement
over the previous behavior.

Lukas Fittl

Discussion: https://postgr.es/m/CAP53PkxeaCuwYmF-A4J5z2-qk5fYFo5_NH3gpXGJJBxv1DMwEw@mail.gmail.com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a6f22e83562d8b78293229587cd3d9430d16d466

Modified Files
--------------
.../expected/pg_stat_statements.out                | 113 ++++++++++++++-------
contrib/pg_stat_statements/pg_stat_statements.c    |  40 ++++++--
.../pg_stat_statements/sql/pg_stat_statements.sql  |  16 ++-
doc/src/sgml/pgstatstatements.sgml                 |  29 ++++--
4 files changed, 142 insertions(+), 56 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1csemX-0000xF-Sc@gemulon.postgresql.org>
Permalink:  ../E1csemX-0000xF-Sc@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1csemX-0000xF-Sc@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Show ignored constants as "$N" rather than "?" in pg_stat_statem
  In-Reply-To: <E1csemX-0000xF-Sc@gemulon.postgresql.org>
  References: <E1csemX-0000xF-Sc@gemulon.postgresql.org>

* 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