pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Make all ereport() calls within gram.y provide error locations.
3+ messages / 2 participants
[nested] [flat]
* pgsql: Make all ereport() calls within gram.y provide error locations.
@ 2024-10-31 20:09 Tom Lane <tgl@sss.pgh.pa.us>
2024-11-01 01:56 ` Re: pgsql: Make all ereport() calls within gram.y provide error locations. Michael Paquier <michael@paquier.xyz>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2024-10-31 20:09 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Make all ereport() calls within gram.y provide error locations.
This patch responds to a comment that I (tgl) made in the
discussion leading up to 774171c4f, that really all errors
occurring during raw parsing should provide error cursors.
Syntax errors reported by Bison will have one, and most of
the handwritten ereport's in gram.y already provide one,
but there were a few stragglers.
(It is not claimed that this handles every failure reachable
during raw parsing --- out-of-memory is an obvious exception.
But this makes a good start on cases that are likely to occur.)
While we're at it, clean up the reported positions for errors
associated with LIMIT/OFFSET clauses. Previously we were
relying on applying exprLocation() to the contained expressions,
but that leads to slightly odd cursor placement, e.g.
regression=# (select * from foo limit 10) limit 10;
ERROR: multiple LIMIT clauses not allowed
LINE 1: (select * from foo limit 10) limit 10;
^
We can afford to keep a little more state in the transient
SelectLimit structs in order to make that better.
Jian He and Tom Lane (extracted from a larger patch by Jian,
with some additional work by me)
Discussion: https://postgr.es/m/CACJufxEmONE3P2En=jopZy1m=cCCUs65M4+1o52MW5og9oaUPA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2d8bff603c9ee7b284b85016fd1a8849ee36368d
Modified Files
--------------
src/backend/parser/gram.y | 74 +++++++++++++++++++++---------
src/test/regress/expected/create_table.out | 2 +
src/test/regress/expected/limit.out | 4 ++
src/test/regress/expected/sqljson.out | 4 ++
4 files changed, 62 insertions(+), 22 deletions(-)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Make all ereport() calls within gram.y provide error locations.
2024-10-31 20:09 pgsql: Make all ereport() calls within gram.y provide error locations. Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-11-01 01:56 ` Michael Paquier <michael@paquier.xyz>
2024-11-01 02:00 ` Re: pgsql: Make all ereport() calls within gram.y provide error locations. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Paquier @ 2024-11-01 01:56 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org
Hi Tom,
On Thu, Oct 31, 2024 at 08:09:38PM +0000, Tom Lane wrote:
> Make all ereport() calls within gram.y provide error locations.
>
> This patch responds to a comment that I (tgl) made in the
> discussion leading up to 774171c4f, that really all errors
> occurring during raw parsing should provide error cursors.
> Syntax errors reported by Bison will have one, and most of
> the handwritten ereport's in gram.y already provide one,
> but there were a few stragglers.
>
> (It is not claimed that this handles every failure reachable
> during raw parsing --- out-of-memory is an obvious exception.
> But this makes a good start on cases that are likely to occur.)
>
> While we're at it, clean up the reported positions for errors
> associated with LIMIT/OFFSET clauses. Previously we were
> relying on applying exprLocation() to the contained expressions,
> but that leads to slightly odd cursor placement, e.g.
The tests of sepgsql need a refresh:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rhinoceros&dt=2024-10-31%2020%3A52%3A13
Thanks,
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Make all ereport() calls within gram.y provide error locations.
2024-10-31 20:09 pgsql: Make all ereport() calls within gram.y provide error locations. Tom Lane <tgl@sss.pgh.pa.us>
2024-11-01 01:56 ` Re: pgsql: Make all ereport() calls within gram.y provide error locations. Michael Paquier <michael@paquier.xyz>
@ 2024-11-01 02:00 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2024-11-01 02:00 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-committers@lists.postgresql.org
Michael Paquier <michael@paquier.xyz> writes:
> The tests of sepgsql need a refresh:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rhinoceros&dt=2024-10-31%2020%3A52%3A13
Yeah, I just noticed that. I'll deal with it tomorrow.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-11-01 02:00 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-31 20:09 pgsql: Make all ereport() calls within gram.y provide error locations. Tom Lane <tgl@sss.pgh.pa.us>
2024-11-01 01:56 ` Michael Paquier <michael@paquier.xyz>
2024-11-01 02:00 ` Tom Lane <tgl@sss.pgh.pa.us>
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