Re: Calling Java from psql (was Re: requesting help) - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: Calling Java from psql (was Re: requesting help)
Date
Msg-id Pine.LNX.4.30.0103292049430.2091-100000@peter.localdomain
Whole thread Raw
In response to Re: Calling Java from psql (was Re: requesting help)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane writes:

> I'm generally pretty suspicious of any system design that requires
> calling outside programs from an SQL function.  The problem is that
> this fundamentally breaks transactional semantics: if the transaction
> is rolled back after the function call, its effects inside the database
> disappear ... but there's no way to roll back whatever the outside
> program did.  Now you have a consistency problem.

The trick here is to organize your outside programs into fairly atomic
chunks and do conservative error logging.  The need to synchronize the
non-database world with the database is definitely real.  But usually a
regular function call near the end of the transaction block is much more
appropriate than a trigger function.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-sql by date:

Previous
From: Jeff Eckermann
Date:
Subject: RE: serial type; race conditions
Next
From: Kyle
Date:
Subject: Possible 7.1RC1 bug