Re: transaction in plpgsql - Mailing list pgsql-sql

From Josh Berkus
Subject Re: transaction in plpgsql
Date
Msg-id web-1560044@davinci.ethosmedia.com
Whole thread Raw
In response to transaction in plpgsql  (Joseph Syjuco <joseph@asti.dost.gov.ph>)
List pgsql-sql
Joe,

> how can i implement transactions inside my plpgsql functions 

You can't.

Each PL/pgSQL function is automatically treated as a single transaction
by Postgres.   As such, the entire function either succeeds or fails.

To manage a transaction *inside* the PL/pgSQL function, Postgres would
have to support nested transactions ... which we currently don't.Nested transactions and MVCC are somewhat of a tangle
toreconcile,
 
and we don't expect a solution until Postgres 8.0 (if then).

-Josh Berkus




pgsql-sql by date:

Previous
From: Joseph Syjuco
Date:
Subject: transaction in plpgsql
Next
From: David BOURIAUD
Date:
Subject: Re: graphical interface - admin