Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
Date
Msg-id CAKFQuwb-S06v-sSs-PekfPRZ8caV9H+R3F+Sv02podWrHO6vjA@mail.gmail.com
Whole thread Raw
In response to Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC  (David Adams <dpadams@gmail.com>)
Responses Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC  (David Adams <dpadams@gmail.com>)
List pgsql-bugs
On Sun, Mar 12, 2023 at 9:57 PM David Adams <dpadams@gmail.com> wrote:
Thanks for the answer, a user error would be best case for me as then I can fix it.

Tom is probably on the right track here with psql versions.

I still say this shouldn't work per the documentation since "return" isn't a valid SQL statement, if you want to use "begin atomic" write "SELECT 'result';" instead as the final statement of the function.  The "return" syntax is shown to only work with the "LANGUAGE SQL RETURN expression;" format.  Though since this does in fact work the docs probably should be tweaked instead.

David J.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
Next
From: David Adams
Date:
Subject: Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC