Re: Fun with nested transactions in PL/pgSQL

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Fun with nested transactions in PL/pgSQL
Дата
Msg-id 20040717220919.GA11041@dcc.uchile.cl
обсуждение исходный текст
Ответ на Fun with nested transactions in PL/pgSQL  ("Jonathan M. Gardner" <jgardner@jonathangardner.net>)
Список pgsql-hackers
On Sat, Jul 17, 2004 at 12:20:27PM -0700, Jonathan M. Gardner wrote:

> => CREATE TABLE t (i int);
> 
> => CREATE OR REPLACE FUNCTION test() RETURNS VOID
> LANGUAGE 'plpgsql' AS '
> BEGIN
>   INSERT INTO t VALUES (1);
>   EXECUTE ''BEGIN'';
>   DELETE FROM t;
>   EXECUTE ''ROLLBACK'';
>   RETURN;
> END
> ';
> 
> => SELECT test();
> server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>         before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.

I described this behavior not less than two weeks ago, including why it
happens.  Try "begin; select test(); commit".

The submitted savepoint patch prevents this from happening, and some
other misbehaviors as well.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"I personally became interested in Linux while I was dating an English major
who wouldn't know an operating system if it walked up and bit him."
(Val Henson)



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Why we really need timelines *now* in PITR
Следующее
От: Gaetano Mendola
Дата:
Сообщение: unused variable