Re: Can I make a function an explicit transaction within? - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Can I make a function an explicit transaction within?
Date
Msg-id 200304171139.15974.josh@agliodbs.com
Whole thread Raw
In response to Can I make a function an explicit transaction within?  (Ivicz László <ivicz@foxart.hu>)
List pgsql-novice
Laci,

> I have tried in 7.3 to make a PL/pgSQL function with an explicit Begin
> Transaction; Rollback; and Commit;.
> The editor allowed to save it (pgAdmin II), but each of the above
> commands caused a
> runtime error in any variation.
> My question is: Can I make a function with explicit transaction in any
> procedural language (mainly in PL/pgSQL)?

I'm afraid not.   In PostgreSQL, each function is by definition a transaction,
and Postgres does not yet support nested transactions.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-novice by date:

Previous
From: "Benjamin RICHARD"
Date:
Subject: Using array in Functions plpgsql
Next
From: Jean-Christian Imbeault
Date:
Subject: select distinct() question