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