Re: Transactions and Locks writing in PLPGSQL

From: tolik(at)aaanet(dot)ru (Anatoly K(dot) Lasareff)
To: Sbastien HEITZMANN <2le(at)2le(dot)net>
Cc: "Allan Kamau" <hugebirdwings(at)yahoo(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Transactions and Locks writing in PLPGSQL
Date: 2001-06-18 08:17:36
Message-ID: 864rtemcbj.fsf@tolikus.hq.aaanet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>>>>> "bH" == bastien HEITZMANN <S> writes:

bH> And what happen when the function call an other function. Does this action
bH> also be rolled back if the first fail ?

Yes, sure.

bH> SEB

AK> Hi all,
AK> How do I write transaction statements like 'BEGIN
AK> WORK'... in PLPGSQL.
AK> Also how do I write lock statements in the same.
AK> Thank you in advance.
>>
AK> Allan Kamau
>>
>> There is no possibility for this. See (from manual):
>>
>> (3) You also cannot have transactions in PL/pgSQL procedures. The
>> entire function (and other functions called from
>> therein) is executed in a transaction and PostgreSQL rolls back
>> the results if something goes wrong. Therefore
>> only one BEGIN statement is allowed.
>>

--
Anatoly K. Lasareff Email: tolik(at)aaanet(dot)ru
http://tolikus.hq.aaanet.ru:8080

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jeremy Buchmann 2001-06-18 18:25:24 Error on pg_dump
Previous Message Jie Liang 2001-06-17 22:39:02 Re: [SQL] Re: need urgent help