Re: transaction management in plpgsql functions - Mailing list pgsql-sql

From Chester Kustarz
Subject Re: transaction management in plpgsql functions
Date
Msg-id Pine.BSO.4.44.0311091613150.19584-100000@detroit.arbor.net
Whole thread Raw
In response to transaction management in plpgsql functions  (Cris Carampa <cris119@operamail.com>)
List pgsql-sql
http://www.postgresql.org/docs/7.2/interactive/plpgsql-structure.html

"It is important not to confuse the use of BEGIN/END for grouping statements in PL/pgSQL with the database commands for
transactioncontrol. PL/pgSQL's BEGIN/END are only for grouping; they do not start or end a transaction. Functions and
triggerprocedures are always executed within a transaction established by an outer query --- they cannot start or
committransactions, since PostgreSQL does not have nested transactions."
 

Makes sense if you think about it.

On Thu, 6 Nov 2003, Cris Carampa wrote:
> It seems that transaction management statements (begin work...commit
> work) are not allowed into plpgsql functions. Is it true? If true, what
> happens if I put a DML statement into a function? Is it automatically
> commited every time the function executes? Is there no way to rollback
> the changes?



pgsql-sql by date:

Previous
From: Yasir Malik
Date:
Subject: Re: help me...
Next
From: Stephan Szabo
Date:
Subject: Re: transaction processing after error in statement