Re: Parsing error with begin atomic syntax used in a do block
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Samuel Dussault <Samuel.Dussault@USherbrooke.ca>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2024-01-18T02:30:07Z
Lists: pgsql-bugs
Attachments
- plpgsql-parse-new-style-create-func.patch (text/x-diff) patch
I wrote: > The problem here is that "begin" is a reserved word in plpgsql > (and for that matter, so is "end"). Oh! I'm mistaken, that is not the issue. The problem is that plpgsql assumes that the SQL command ends at the first semicolon. psql has pretty much this same issue of "does this semicolon end the command", and it has some heuristics for dealing with that. Since that's survived awhile now without complaints, we could do worse than to propagate the identical heuristics into plpgsql, more or less as attached. (This also fixes the same problem for multi-command CREATE RULE, which has been broken in plpgsql since the late bronze age; but there were not enough people complaining to prompt a fix.) regards, tom lane
Commits
-
Fix plpgsql to allow new-style SQL CREATE FUNCTION as a SQL command.
- 57b440ec115f 17.0 landed
- de2d393a8a87 15.6 landed
- b7e8f27d1478 14.11 landed
- 00f941356e56 16.2 landed