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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 04:34:41
Message-ID: 1666633.1678682081@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Adams <dpadams(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2023-03-13 04:47:26 Re: psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC
Previous Message David Adams 2023-03-13 04:20:28 psql 14.7/15.2 report a bogus syntax error on function and procedure files that use BEGIN ATOMIC