Search Postgresql Archives

Re: Question on how to conditionally commit or rollback a sql-request

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

 



	Bergbom Staffan wrote:

> I get the following error:
> ERROR: SPI execute_plan failed executing query “Commit”:
> SPI_ERROR_TRANSACTION
> CONTEXT: Pl/pgSQL function “objectdescription_bu” line 9 at SQL statement
>  
> What does this mean and what should I do to be able to do the desired check

It's not possible to commit or rollback inside a function.
Instead of issuing a rollback, you could raise an exception, and instead of
doing a commit, you should do nothing at all.

Best regards,
-- 
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

-- 
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