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:34:41 -0400
Message-ID: <1666633.1678682081@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPXPcQuSEWTCqVnoiVALpkdAM_HXXdAf8kYm0WYF8Z2htX6v-A@mail.gmail.com>
References: <CAPXPcQuSEWTCqVnoiVALpkdAM_HXXdAf8kYm0WYF8Z2htX6v-A@mail.gmail.com>
David Adams <dpadams@gmail.com> writes:
> CREATE OR REPLACE FUNCTION tools.tell_me_how_atomic()
> RETURNS text
> LANGUAGE SQL
> BEGIN ATOMIC
> return 'atomic';
> END;
> [ throws a syntax error ]
This works for me. I wonder if you have some issues with bogus
invisible characters in your actual input file. Copying and
pasting from your mail (but removing the schema name for
convenience), I got
regression=# CREATE OR REPLACE FUNCTION tell_me_how_atomic()
regression-#
regression-# RETURNS text
regression-#
regression-# LANGUAGE SQL
regression-#
regression-# BEGIN ATOMIC
regression-#
regression-# return 'atomic';
regression-#
regression-# END;
CREATE FUNCTION
regression=# select * from tell_me_how_atomic()
regression-# ;
tell_me_how_atomic
--------------------
atomic
(1 row)
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: <1666633.1678682081@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