Transaction inside of functions

From: "A B" <gentosaker(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Transaction inside of functions
Date: 2008-05-15 13:32:57
Message-ID: dbbf25900805150632v58e16e0bl63a72795051a0ee0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Is it not possible to define transactions inside of a function?
I guess you can do

BEGIN WORK;
select my_function()
COMMIT;

instead of defining the function
CREATE FUNCTION my_function()...
BEGIN
BEGIN WORK;
....
COMMIT;
END;

but what if you would like to do

CREATE FUNCTION my_function()...
BEGIN
.... do stuff.....
BEGIN WORK;
....
COMMIT;
do more stuff ....
END;

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message A. Kretschmer 2008-05-15 13:41:45 Re: Transaction inside of functions
Previous Message Greg Cocks 2008-05-13 17:26:43 Re: Disadvantages to using "text" [ArcGIS]