Re: Transactions in PLPGSQL? - Mailing list pgsql-sql

From tolik@aaanet.ru (Anatoly K. Lasareff)
Subject Re: Transactions in PLPGSQL?
Date
Msg-id 86pugvudt2.fsf@tolikus.hq.aaanet.ru
Whole thread Raw
In response to Transactions in PLPGSQL?  (Ken Corey <zkyar66701p001@sneakemail.com>)
List pgsql-sql
>>>>> "KC" == Ken Corey <zkyar66701p001@sneakemail.com> writes:
KC> Hi All!KC> Are the BEGIN/END; seen in a typical PL/PGSQL function a transaction wrapper, KC> or do I need to add
anotherBEGIN/END block?
 

No, BEGIN & END in plpgsql function are not transaction control
statemens, but elements of plpgsql language. 
KC> Should I just put a 'rollback' in the function, or do I need to do something KC> special?

You _cannot_ use any transaction control statemens (commit, rollback)
into plpgsql function. So all the function must be in transaction block.

-- 
Anatoly K. Lasareff                 Email:    tolik@aaanet.ru 
http://tolikus.hq.aaanet.ru:8080    Phone:      (8632)-710071


pgsql-sql by date:

Previous
From: tolik@aaanet.ru (Anatoly K. Lasareff)
Date:
Subject: Re: PL/PGSQL function with parameters
Next
From: Brice Ruth
Date:
Subject: Re: SQL Join - MySQL/PostgreSQL difference?