Re: Transactions in PLPGSQL?

From: tolik(at)aaanet(dot)ru (Anatoly K(dot) Lasareff)
To: Ken Corey <zkyar66701p001(at)sneakemail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Transactions in PLPGSQL?
Date: 2001-02-07 07:56:09
Message-ID: 86pugvudt2.fsf@tolikus.hq.aaanet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>>>>> "KC" == Ken Corey <zkyar66701p001(at)sneakemail(dot)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 another BEGIN/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(at)aaanet(dot)ru
http://tolikus.hq.aaanet.ru:8080 Phone: (8632)-710071

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message The Hermit Hacker 2001-02-07 14:24:53 Re: Postgres-HOWTO
Previous Message Anatoly K. Lasareff 2001-02-07 07:52:32 Re: PL/PGSQL function with parameters