Thursday, May 15, 2008

[NOVICE] Transaction inside of functions

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;

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

No comments: