[postgis-users] [GENERAL] Basic question on PGSQL andTransactions

Josh Preston Josh.Preston at rpdata.com
Wed Sep 29 15:24:45 PDT 2010


PL/PGSQL functions are already inside a transaction when you execute
them, therefore you cannot explicitly define your own transaction
(BEGIN/COMMIT) block inside a function.

 

http://www.postgresql.org/docs/8.3/static/plpgsql-structure.html (Last
paragraph)

 

 

Josh

 

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Henri De Feraudy
Sent: Thursday, 30 September 2010 4:57 AM
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] [GENERAL] Basic question on PGSQL
andTransactions

 

I just tried putting commit work inside a PL/PGSQL function
insert_my_data() and then tried 

calling this function. I got a runtime error.

 

 

________________________________

From: Alban Hertroys <dalroi at solfertje.student.utwente.nl>
To: Henri De Feraudy <feraudyh at yahoo.com>
Cc: pgsql-general at postgresql.org
Sent: Wed, September 29, 2010 7:04:52 PM
Subject: Re: [GENERAL] Basic question on PGSQL and Transactions

On 29 Sep 2010, at 18:31, Henri De Feraudy wrote:

> I mean, if you are inserting into a table from PLPGSQL do you have to
do an 
> explicit commit at some stage?

I suppose you meant psql here, as otherwise the above statement wouldn't
make sense ;)

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:1175,4ca371bc678302094595771!




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100930/24151fdf/attachment.html>


More information about the postgis-users mailing list