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 Tom Lane
Subject Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
Date
Msg-id 1669793.1678683562@sss.pgh.pa.us
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
David Adams <dpadams@gmail.com> writes:
> As far as I know, the problem only shows up with reading in a file with -f
> or <: That's a bit different to entering the lines one by one.

No joy on that either ...

$ cat test.sql 
CREATE OR REPLACE FUNCTION tell_me_how_atomic()
RETURNS text
LANGUAGE SQL
BEGIN ATOMIC
return 'atomic';
END;
$ psql -f test.sql
CREATE FUNCTION
$ cat test.sql | psql
CREATE FUNCTION

> I've checked again, and can't find any gremlins/invisible characters in the
> source file, attached. And, this only happens with scripts that use BEGIN
> ATOMIC, and it seems to happen on all of those files.

Are you entirely sure you're using a new-enough psql?  I can replicate
your symptom if I try to use v13 psql to send this command to a
v14-or-later server.

            regards, tom lane



pgsql-bugs by date:

Previous
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
Next
From: "David G. Johnston"
Date:
Subject: Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC