Re: unique & update
От | Doug McNaught |
---|---|
Тема | Re: unique & update |
Дата | |
Msg-id | m3aduuuxpj.fsf@varsoon.denali.to обсуждение исходный текст |
Ответ на | Re: unique & update (Stephan Szabo <sszabo@megazone23.bigpanda.com>) |
Ответы |
Re: unique & update
|
Список | pgsql-general |
"Ben-Nes Michael" <miki@canaan.co.il> writes: > How can I rollback in a function ? > I mean after update has been done, I do some checking in the Function and > then decide that I want to quit and rollback all what inserted/updated in > the start of the function ? A function is always executed inside a transaction. You can roll back the whole transaction by throwing an error, but you can't roll back just what you did in the function. There is talk of adding savepoints to PG (possibly in 7.3) which would allow this, but right now there is no mechanism for it. > Also if I attach trigger that check column uniqueness to an update will it > check it per updated row or at the end of the action after all the table got > updated ? Why not just create a unique index rather than using a trigger? -Doug -- Let us cross over the river, and rest under the shade of the trees. --T. J. Jackson, 1863
В списке pgsql-general по дате отправления: