pgsql: Teach contrib/pg_stat_statements to handle multi-statement comma

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Teach contrib/pg_stat_statements to handle multi-statement comma
Date: 2017-01-14 21:17:41
Message-ID: E1cSVhl-0007qI-Po@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Teach contrib/pg_stat_statements to handle multi-statement commands better.

Make use of the statement boundary info added by commit ab1f0c822
to let pg_stat_statements behave more sanely when multiple SQL queries
are jammed into one query string. It now records just the relevant
part of the source string, not the whole thing, for each individual
query.

Even when no multi-statement strings are involved, users may notice small
changes in the output: leading and trailing whitespace and semicolons will
be stripped from statements, which did not happen before.

Also, significantly expand pg_stat_statements' regression test script.

Fabien Coelho, reviewed by Craig Ringer and Kyotaro Horiguchi,
some mods by me

Discussion: https://postgr.es/m/alpine.DEB.2.20.1612200926310.29821@lancre

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/83f2061dd037477ec8479ee160367840e203a722

Modified Files
--------------
.../expected/pg_stat_statements.out | 362 ++++++++++++++++++++-
contrib/pg_stat_statements/pg_stat_statements.c | 103 ++++--
.../pg_stat_statements/sql/pg_stat_statements.sql | 179 +++++++++-
3 files changed, 606 insertions(+), 38 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-01-15 19:09:45 pgsql: Fix matching of boolean index columns to sort ordering.
Previous Message Tom Lane 2017-01-14 21:02:54 pgsql: Change representation of statement lists, and add statement loca