This is a discussion on Problem while using start transaction ans commit; within the pgsql Sql forums, part of the PostgreSQL category; --> Hi All, I have a small problem in using nested transactions while working on Postgres 8.0. Ex: I have ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi All, I have a small problem in using nested transactions while working on Postgres 8.0. Ex: I have a function A() which in turn calls functions b() and c() , if i want commit something in b or c. i have to use start transaction read write; -- set of sql statements and then say commit. commit; but this is not working it is showing the the following error near start transaction read write " ERROR: SPI_execute_plan failed executing query "start transaction read write": SPI_ERROR_TRANSACTION "; or if i use only commit with out the start transaction command it throwing the runtime error as " ERROR: SPI_execute_plan failed executing query "commit": SPI_ERROR_TRANSACTION "; Can any one send me an example of how to use the start transaction or how to commit an nested transaction. Thanks in advance. Thanks & Regards, Sri |
| ||||
| On Mon, 2005-10-17 at 12:53 +0530, Sri wrote: > Hi All, > > I have a small problem in using nested transactions while working on > Postgres 8.0. > > Ex: I have a function A() which in turn calls functions b() and c() , > if i want commit something in b or c. i have to use You cannot start or commit a transaction inside a function. You can use savepoints. -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== Do you want to know God? http://www.lfix.co.uk/knowing_god.html ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |