Re: ROLLBACK in a function?
От | Rory Campbell-Lange |
---|---|
Тема | Re: ROLLBACK in a function? |
Дата | |
Msg-id | 20030529085855.GA8431@campbell-lange.net обсуждение исходный текст |
Ответ на | Re: ROLLBACK in a function? (Doug McNaught <doug@mcnaught.org>) |
Ответы |
Re: ROLLBACK in a function?
|
Список | pgsql-general |
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>
В списке pgsql-general по дате отправления: