Re: [subxacts] Aborting a function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [subxacts] Aborting a function
Date
Msg-id 3130.1089436582@sss.pgh.pa.us
Whole thread Raw
In response to [subxacts] Aborting a function  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: [subxacts] Aborting a function
List pgsql-hackers
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> (We could talk about exception support in plpgsql or other language
> handlers but I don't think this is going to happen for 7.5.)

Au contraire ... I think it *must* happen, and indeed that
subtransaction support in plpgsql is not different from exceptions.
Per Honza Pazdziora's recent post:

>> The syntax of handling exceptions is (in PL/SQL):
>> 
>>     BEGIN
>>         some code, for example a bunch of SQL commands;
>>     EXCEPTION
>>         WHEN nameofexception THEN
>>             handle the exception, maybe ROLLBACK;
>>     END;

This should be exactly how you invoke a subtransaction in plpgsql.
Anything else will be too messy to contemplate...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: [PATCHES] Fixes for pg_dump and ownership/acl problems
Next
From: Tom Lane
Date:
Subject: Re: User Quota Implementation