Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
Дата
Msg-id 37325fb7-8014-4028-9bcf-60d83f4fe8dd@manitou-mail.org
обсуждение исходный текст
Ответ на Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
    David G. Johnston wrote:


> drop table if exists performupdate;
> create table performupdate (val integer);
> insert into performupdate values (2);
> \startpipeline
> update performupdate set val = val * 2;
> --create database benchtest;
> select 1/0;
> --rollback
> \endpipeline
> DO $$BEGIN RAISE NOTICE 'Value = %', (select val from performupdate); END;
> $$
>
> I get this result - the post-pipeline DO block never executes and I
> expected that it would.

pgbench stops the script on errors. If the script was reduced to

 select 1/0;
 DO $$BEGIN RAISE NOTICE 'print this; END; $$

the DO statement would not be executed either.
When the error happens inside a pipeline section, it's the same.
The pgbench code collects the results sent by the server to clear up,
but the script is aborted at this point, and the DO block is not going
to be sent to the server.


Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite



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

Предыдущее
От: Timo Stolz
Дата:
Сообщение: If a row-level security policy contains a set returning function, pg_dump returns an incorrect serialization of that policy if the return type of the function was altered
Следующее
От: Harinath Kanchu
Дата:
Сообщение: Trusted extension cannot be dropped by the owner of the extension