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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Adams <dpadams(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
Date: 2023-03-13 05:04:17
Message-ID: CAKFQuwb-S06v-sSs-PekfPRZ8caV9H+R3F+Sv02podWrHO6vjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Mar 12, 2023 at 9:57 PM David Adams <dpadams(at)gmail(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Adams 2023-03-13 05:07:29 Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
Previous Message Tom Lane 2023-03-13 04:59:22 Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC