pgsql: plpgsql: report proper line number for errors in variable initia

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: plpgsql: report proper line number for errors in variable initia
Date: 2021-10-31 16:43:56
Message-ID: E1mhDw4-0000Yz-NW@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

plpgsql: report proper line number for errors in variable initialization.

Previously, we pointed at the surrounding block's BEGIN keyword.
If there are multiple variables being initialized in a DECLARE section,
this isn't good enough: it can be quite confusing and unhelpful.
We do know where the variable's declaration started, so it just takes
a tiny bit more error-reporting infrastructure to use that.

Discussion: https://postgr.es/m/713975.1635530414@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/acb2d7d5d2301f07d5857ee252995e62ce9e7055

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_domain.out | 14 +++++-----
src/pl/plpgsql/src/expected/plpgsql_varprops.out | 22 +++++++--------
src/pl/plpgsql/src/pl_exec.c | 35 ++++++++++++++++++------
src/pl/plpgsql/src/plpgsql.h | 1 +
src/test/regress/expected/domain.out | 4 +--
src/test/regress/expected/plpgsql.out | 4 +--
6 files changed, 49 insertions(+), 31 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-10-31 19:32:21 pgsql: Avoid O(N^2) behavior when the standby process releases many loc
Previous Message Peter Eisentraut 2021-10-30 17:35:57 pgsql: pg_dump: Refactor messages