second "begin transaction" emits a warning

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема second "begin transaction" emits a warning
Дата
Msg-id c2d9e70e0512161436s57f1e04exb2a21da7d6878c86@mail.gmail.com
обсуждение исходный текст
Ответы Re: second "begin transaction" emits a warning  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: second "begin transaction" emits a warning  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-hackers
Hi,

recently someone show us this code in the spanish list...

> BEGIN WORK;
> INSERT INTO mitabla VALUES (1);
>    BEGIN TRANSACTION;
>     INSERT INTO mitabla VALUES (2);
>     INSERT INTO mitabla VALUES (3);
>    COMMIT TRANSACTION;
> INSERT INTO mitabla VALUES (4);
> ROLLBACK WORK;

this is clearly bad you can't use a begin transaction inside a
transaction... but the user was expecting other results and because he
receives no error (actually was a warning but he is sending the
commands via an external application)...

he was expecting an empty table but instead he gets this:

mitabla
========
1
2
3
(3 rows)

so, why BeginTransactionBlock emits just a warning and not an error?
this is not the same as in the case of the one who was closing and
already closed cursor?

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Self-modifying code
Следующее
От: Robert Treat
Дата:
Сообщение: reducing bloat in pg_statistic