pgsql: Bend parse location rules for the convenience of pg_stat_stateme

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Bend parse location rules for the convenience of pg_stat_stateme
Date: 2012-03-27 19:18:06
Message-ID: E1SCbuA-0003M7-41@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Bend parse location rules for the convenience of pg_stat_statements.

Generally, the parse location assigned to a multiple-token construct is
the location of its leftmost token. This commit breaks that rule for
the syntaxes TYPENAME 'LITERAL' and CAST(CONSTANT AS TYPENAME) --- the
resulting Const will have the location of the literal string, not the
typename or CAST keyword. The cases where this matters are pretty thin on
the ground (no error messages in the regression tests change, for example),
and it's unlikely that any user would be confused anyway by an error cursor
pointing at the literal. But still it's less than consistent. The reason
for changing it is that contrib/pg_stat_statements wants to know the parse
location of the original literal, and it was agreed that this is the least
unpleasant way to preserve that information through parse analysis.

Peter Geoghegan

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5d3fcc4c2e137417ef470d604fee5e452b22f6a7

Modified Files
--------------
src/backend/parser/parse_coerce.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2012-03-27 19:19:51 pgsql: Expose track_iotiming information via pg_stat_statements.
Previous Message Robert Haas 2012-03-27 18:56:39 pgsql: New GUC, track_iotiming, to track I/O timings.