Unix Technical Forum

Problem while using start transaction ans commit;

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


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Sql

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 11:50 AM
Sri
 
Posts: n/a
Default Problem while using start transaction ans commit;

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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 11:50 AM
Oliver Elphick
 
Posts: n/a
Default Re: Problem while using start transaction ans commit;

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:41 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com