Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbZtZ-00007E-Vc for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Mar 2023 04:34:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pbZtY-0005l8-59 for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Mar 2023 04:34:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbZtX-0005kz-T3 for pgsql-bugs@lists.postgresql.org; Mon, 13 Mar 2023 04:34:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbZtU-0008HW-5I for pgsql-bugs@lists.postgresql.org; Mon, 13 Mar 2023 04:34:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 32D4Yf5J1666634; Mon, 13 Mar 2023 00:34:41 -0400 From: Tom Lane To: David Adams 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 In-reply-to: References: Comments: In-reply-to David Adams message dated "Mon, 13 Mar 2023 15:20:28 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1666632.1678682081.1@sss.pgh.pa.us> Date: Mon, 13 Mar 2023 00:34:41 -0400 Message-ID: <1666633.1678682081@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Adams 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