On 28/05/03, Doug McNaught (doug@mcnaught.org) wrote:
> Rory Campbell-Lange <rory@campbell-lange.net> writes:
>
> > I understand that functions provide an implied transaction in
> > PostgreSQL.
>
> Not quite. Every SQL statement is executed in its own transaction if
> BEGIN/END are not explicitly used. A statment may cause zero, one or
> many function calls, but they will all execute in that transaction.
>
> > Does that mean one can ROLLBACK/COMMIT within the body of a
> > function?
>
> Not in current versions.
So in my (eg php) code I should do something like this psuedo code?
BEGIN WORK
select function ([params])
if
result == 0
then
rollback
else
commit
end if
END WORK
Rory
--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>