Skip site navigation (1) Skip section navigation (2)

Re: Stored Procedures

From: Chris Travers <chris(at)metatrontech(dot)com>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Kent Anderson <kenta(at)ezyield(dot)com>,"Pgsql-General(at)Postgresql(dot) Org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Stored Procedures
Date: 2004-09-21 18:11:33
Message-ID: 41506ED5.8080300@metatrontech.com (view raw or flat)
Thread:
Lists: pgsql-general
Alvaro Herrera wrote:

>On Tue, Sep 21, 2004 at 07:41:31AM -0400, Kent Anderson wrote:
>  
>
>>We are currently switching to stored procedures for a lot of our database
>>activity. The question has come up about the transactional nature of the
>>stored procedures.  I was wondering if stored procedures can have
>>transactions in them or if you must start the transaction in your code and
>>call the stored procedure from there to get the safety of a transaction?
>>    
>>
>
>There's only one transaction (whether it's an explicit transaction block
>or an implicit one), and the query that invokes the stored procedure is
>already running inside it.  So the stored procedure always has the
>safety of it, and it can't get out (except by raising an error and
>aborting the whole thing).  The transaction can only be committed
>_after_ the stored procedure has finished succesfully.
>
>  
>
I am assuming that save points would still work as advertised in stored 
procedures....

Best Wishes,
Chris Travers
Metatron Technology Consulting

Attachment: chris.vcf
Description: text/x-vcard (127 bytes)

In response to

Responses

pgsql-general by date

Next:From: Kevin MurphyDate: 2004-09-21 18:16:44
Subject: the current scoop on ilike and indexes
Previous:From: Greg StarkDate: 2004-09-21 18:08:50
Subject: Re: Oracle / Postgres Interface

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group