Re: PL/perl elog(ERROR) Does not Abort Transaction

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: PL/perl elog(ERROR) Does not Abort Transaction
Дата
Msg-id 20120511002046.GG16881@momjian.us
обсуждение исходный текст
Ответ на PL/perl elog(ERROR) Does not Abort Transaction  ("David E. Wheeler" <david.wheeler@iovation.com>)
Ответы Re: PL/perl elog(ERROR) Does not Abort Transaction  ("David E. Wheeler" <david.wheeler@iovation.com>)
Список pgsql-hackers
On Thu, May 10, 2012 at 04:21:24PM -0700, David E. Wheeler wrote:
> Hackers,
> 
> Shouldn't a call to elog(NOTICE) invalidate the current tranaction?

I assume you mean elog(ERROR)?

>     david=# begin;
>     BEGIN
>     Time: 0.178 ms
>     david=# do language plperl $$ elog(ERROR, 'foo')$$;
>     ERROR:  foo at line 1.
>     CONTEXT:  PL/Perl anonymous code block
>     david=# select true;
>      bool 
>     ------
>      t
>     (1 row)
> 
>     Time: 0.203 ms
> 
> The docs say:
> 
> > ERROR raises an error condition; if this is not trapped by the surrounding Perl code, the error propagates out to
thecalling query, causing the current transaction or subtransaction to be aborted.
 
> 
> So I'm surprised that the transaction is not aborted. Bug?

Well, git head show an error:
test=> begin;BEGINtest=> do language plperl $$ elog(ERROR, 'foo')$$;ERROR:  foo at line 1.CONTEXT:  PL/Perl anonymous
codeblocktest=> select true;ERROR:  current transaction is aborted, commands ignored until end oftransaction block
 

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: synchronous_commit and remote_write
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: PL/perl elog(ERROR) Does not Abort Transaction