Parsing error with begin atomic syntax used in a do block - Mailing list pgsql-bugs

From Samuel Dussault
Subject Parsing error with begin atomic syntax used in a do block
Date
Msg-id YT2PR01MB88552C3E9AD40A6C038774A781722@YT2PR01MB8855.CANPRD01.PROD.OUTLOOK.COM
Whole thread Raw
Responses Re: Parsing error with begin atomic syntax used in a do block
List pgsql-bugs

Hi,

 

I encounter a problem when creating a procedure using the begin atomic syntax in a script encapsulated in a DO block. When executing the DO block, the parser throws a syntax error. I would expect to be able to create the procedure with both the new begin atomic and the old syntax.

 

The attached script, demo.sql, highlights the problem and expected behaviours. First, it prints the PostgreSQL version, creates an example table and sets the verbosity parameter to verbose. Then, it successfully creates a procedure using the new begin atomic syntax. Afterwards, it successfully creates the same function using the old syntax but encapsulates the instruction in a do block. Finally, it fails to create the same function using the new syntax with the do block.

 

The attached file demo.out shows the output I get when executing the script using psql (version: psql (PostgreSQL) 16.0):

PGPASSWORD=postgres psql -h localhost -U postgres -p 15432 -d postgres -f demo.sql &> demo.out

 

Thank you for your time,

Samuel Dussault

Attachment

pgsql-bugs by date:

Previous
From: Leo Gaspard
Date:
Subject: jsonb numerics are treated as arrays
Next
From: Tom Lane
Date:
Subject: Re: Parsing error with begin atomic syntax used in a do block