Search Postgresql Archives

Trouble with Savepoints in postgres

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

 



Iam not able to use savepoints i postgres.
Iam using version 8.2.
If i write something like this :
CREATE OR REPLACE FUNCTION test_savepoint()
  RETURNS void AS
$BODY$
DECLARE

BEGIN
SAVEPOINT foo;
    INSERT INTO table1 VALUES (3);

   INSERT INTO table1 VALUES (4);
    ROLLBACK TO foo;
COMMIT;

END;

$BODY$
  LANGUAGE 'plpgsql' VOLATILE;


when i try to excute this function it throws me an error:
ERROR: SPI_execute_plan failed executing query "SAVEPOINT foo":
SPI_ERROR_TRANSACTION
SQL state: XX000

Iam not able to understand if this is a version problem or the way iam
using savepoints is wrong.Please advice.

Thanks
Sam

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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