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

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 (view raw or flat)
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

pgsql-novice by date

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

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