Search Postgresql Archives

Re: use SAVEPOINT function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The error msg is:

SPI_execute_plan failed executing query "SAVEPOINT savepoint1": SPI_ERROR_TRANSACTION


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



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux