Frank.Motzkat@xxxxxxx writes: > I would like using savepoints in my stored functions but I always get the > error > ERROR: SPI_execute_plan failed executing query "SAVEPOINT my_savepoint": In plpgsql, you're supposed to use exception blocks instead. See http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING regards, tom lane