Re: pl/python explicit subtransactions

Поиск
Список
Период
Сортировка
От Steve Singer
Тема Re: pl/python explicit subtransactions
Дата
Msg-id BLU0-SMTP7880F6FF9D4EC4C27F71A8EEC0@phx.gbl
обсуждение исходный текст
Ответ на Re: pl/python explicit subtransactions  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: pl/python explicit subtransactions  (Jan Urbański <wulczer@wulczer.org>)
Список pgsql-hackers
On 11-02-09 05:22 PM, Peter Eisentraut wrote:
> On tis, 2011-02-08 at 00:32 -0500, Steve Singer wrote:
>> On 11-02-06 11:40 AM, Jan Urbański wrote:
>>
>>> PFA an updated patch with documentation.
>>> Yeah, changed them.
>> Those changes look fine.  The tests now pass.
>>
>> I've attached a new version of the patch that fixes a few typos/wording
>> issues I saw in the documentation.  I also changed the link to the
>> python reference manual section on context managers. I think it is
>> better to link to that versus the original PEP.
>>
>> The documentation could probably still use more word-smithing but that
>> can happen later.  I'm marking this as ready for a committer.
> Is it necessarily a good idea that an explicit subtransaction disables
> the implicit sub-subtransactions?  It might be conceivable that you'd
> still want to do some try/catch within explicit subtransactions.
>
>

I had tested nested subtransactions but not a normal try/catch within a 
subtransaction.  That sounds reasonable to allow.

Unfortunately it leads to:


test=# create table foo(a int4 primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 
"foo_pkey" for table "foo"
CREATE TABLE
test=# DO $$
test$# try:
test$#   with plpy.subtransaction():
test$#     plpy.execute("insert into foo values(1)")
test$#     try:
test$#       plpy.execute("insert into foo values(1)")
test$#     except:
test$#       plpy.notice('inside exception')
test$# except plpy.SPIError:
test$#   f=0
test$# $$ language plpythonu;
TRAP: FailedAssertion("!(afterTriggers->query_depth == 
afterTriggers->depth_stack[my_level])", File: "trigger.c", Line: 3846)
NOTICE:  inside exception
CONTEXT:  PL/Python anonymous code block
server closed the connection unexpectedly    This probably means the server terminated abnormally    before or while
processingthe request.
 




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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: new clang report
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: another mvcc.sgml typo