From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Adams <dpadams@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
Date: Mon, 13 Mar 2023 00:59:22 -0400
Message-ID: <1669793.1678683562@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPXPcQu8bUcJ3gJ3L_htXiPDpMZPh78+jncNhi+ypyiOKoxhog@mail.gmail.com>
References: <CAPXPcQuSEWTCqVnoiVALpkdAM_HXXdAf8kYm0WYF8Z2htX6v-A@mail.gmail.com>
<1666633.1678682081@sss.pgh.pa.us>
<CAPXPcQu8bUcJ3gJ3L_htXiPDpMZPh78+jncNhi+ypyiOKoxhog@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, dpadams@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
In-Reply-To: <1669793.1678683562@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox