Re: PL/pgSQL: EXCEPTION NOSAVEPOINT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matt Miller <mattm(at)epx(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: PL/pgSQL: EXCEPTION NOSAVEPOINT
Date: 2005-08-03 20:48:06
Message-ID: 3882.1123102086@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

Matt Miller <mattm(at)epx(dot)com> writes:
> On Wed, 2005-08-03 at 16:25 -0400, Tom Lane wrote:
>> You do not have the
>> option to continue processing after elog(ERROR); the (sub)transaction
>> rollback is necessary to clean up inconsistent state.

> Okay, I'll look at this more closely. Can you give me an example of
> what can go wrong?

Well, for example, failure to release locks and buffer pins held by an
abandoned query. Memory leaks. Row versions inserted into the database
that will be seen as good because they're marked as being generated by
the outer transaction, rather than coming from a subtransaction that can
be separately marked as aborted. Pretty much everything done by
AbortSubTransaction can be seen as cleanup...

The only way you could get the effect you are after would be to run a
new subtransaction for each executed query; which is not impossible
but the overhead would be appalling :-(

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aaron Harsh 2005-08-03 21:18:33 Re: oids and pg_class_oid_index constraint
Previous Message Tom Lane 2005-08-03 20:33:29 Re: oids and pg_class_oid_index constraint violations

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-08-03 20:49:15 Re: openbsd, plpython, missing threading symbols
Previous Message Matt Miller 2005-08-03 20:32:30 Re: PL/pgSQL: EXCEPTION NOSAVEPOINT

Browse pgsql-patches by date

  From Date Subject
Next Message Qingqing Zhou 2005-08-04 08:53:51 prevent encoding conversion recursive error
Previous Message Matt Miller 2005-08-03 20:32:30 Re: PL/pgSQL: EXCEPTION NOSAVEPOINT