-
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
ow...@postgresql.org] On Behalf Of Craig Ringer
Sent: Sunday, May 23, 2010 8:48 PM
To: Ken Winter
Cc: PostgreSQL pg-general List
Subject: Re: [GENERAL] ROLLBACK in a function
On 24/05/10 02:51, Ken Winter wrote:
How can I write
How can I write a PL/PgSQL function that rolls back every database change it
has done?
I'm about to write a set of database test functions. Each function needs to
do some INSERT, UPDATE, or DELETE actions, test whether they had their
intended effect, and then roll back the test changes to
On 24/05/10 02:51, Ken Winter wrote:
How can I write a PL/PgSQL function that rolls back every database
change it has done?
Have it raise an exception, causing the surrounding transaction to
terminate with an error.
Another function calling yours can still catch the exception and handle
If a function generates an exception, do I need to rollback manually?
--
Rory Campbell-Lange
[EMAIL PROTECTED]
www.campbell-lange.net
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster