Parsing error with begin atomic syntax used in a do block

Поиск
Список
Период
Сортировка
От Samuel Dussault
Тема Parsing error with begin atomic syntax used in a do block
Дата
Msg-id YT2PR01MB88552C3E9AD40A6C038774A781722@YT2PR01MB8855.CANPRD01.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы Re: Parsing error with begin atomic syntax used in a do block  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Leo Gaspard
Дата:
Сообщение: jsonb numerics are treated as arrays
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Parsing error with begin atomic syntax used in a do block