Re: Error handling in plperl and pltcl

From: James Robinson <jlrobins(at)socialserve(dot)com>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Brett Schwarz <brett_schwarz(at)Yahoo(dot)com>, Hackers <pgsql-hackers(at)postgresql(dot)org>, James William Pye <flaw(at)rhid(dot)com>, Thomas Hallgren <thhal(at)mailblocks(dot)com>, Richard Huxton <dev(at)archonet(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Error handling in plperl and pltcl
Date: 2004-12-03 19:42:59
Message-ID: 897A4E76-4563-11D9-9A1E-000A9566A412@socialserve.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Dec 3, 2004, at 2:04 PM, Jan Wieck wrote:
[snip]

>
> The point we where coming from was Tom's proposal to wrap each and
> every single SPI call into its own subtransaction for semantic
> reasons. My proposal was an improvement to that with respect to
> performance and IMHO also better matching the semantics.
>
> Your suggestion to expose a plain savepoint interface to the
> programmer leads directly to the possiblity to commit a savepoint made
> by a sub-function in the caller and vice versa - which if I understood
> Tom correctly is what we need to avoid.
>

The JDBC interface exposes the savepoint interface, via setSavepoint(),
releaseSavepoint(), and rollback(Savepoint sp) methods on the
Connection, and Thomas's design of PL/Java offers the SPI via mapping
it onto JDBC. Would client-side JDBC also suffer from the same
potential issue of 'commit a savepoint made by a sub-function'? Or is
this something SPI-specific? Or, finally, is this an issue of
interacting with other PL languages who won't expose savepoint-ish
functionality?

IMO, if it smells like JDBC, it oughta smell as close to 100% like
JDBC, allowing folks to possibly relocate some of their code to run
inside PG. Ugly savepoint handling and all.

----
James Robinson
Socialserve.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-12-03 19:54:00 Re: Error handling in plperl and pltcl
Previous Message Peter Eisentraut 2004-12-03 19:32:41 Calling for translation finalization