Re: Can I make a function an explicit transaction within?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Ivicz László <ivicz(at)foxart(dot)hu>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Can I make a function an explicit transaction within?
Date: 2003-04-17 18:39:15
Message-ID: 200304171139.15974.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jean-Christian Imbeault 2003-04-18 03:49:26 select distinct() question
Previous Message Benjamin RICHARD 2003-04-17 13:37:20 Using array in Functions plpgsql