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: [email protected] [mailto:[email protected]] On Behalf Of Henri De Feraudy Sent: Thursday, 30 September 2010 4:57 AM To: [email protected] 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 <[email protected]> To: Henri De Feraudy <[email protected]> Cc: [email protected] 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 ______________________________________________________________________
_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
