use SAVEPOINT function

From: Ying Lu <ying_lu(at)cs(dot)concordia(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: use SAVEPOINT function
Date: 2005-04-14 20:10:18
Message-ID: 425ECE2A.90508@cs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

I'd like to know is it possible to use "SAVEPOINT" in a function? In the
following example, I got an error when calling this function:

CREATE OR REPLACE function test() returns trigger as $test$
BEGIN
SAVEPOINT savepoint1;
... ...
COMMIT;
RETURN NEW;

EXCEPTION
when RAISE_EXCEPTION THEN
ROLLBACK TO SAVEPOINT savepoint1;

END;
$test$ language plpgsql;

Thanks a lot,
Emi

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ying Lu 2005-04-14 20:17:58 Re: use SAVEPOINT function
Previous Message Pavel Stehule 2005-04-14 20:07:35 Re: Help with process list