Re: Help with trigger that updates a row prior to a potentially aborted deletion?

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Help with trigger that updates a row prior to a potentially aborted deletion?
Дата
Msg-id 20060301182345.GJ17356@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Help with trigger that updates a row prior to a potentially aborted deletion?  ("Simon Kinsella" <simon@bluefiresystems.co.uk>)
Ответы Re: Help with trigger that updates a row prior to a potentially aborted deletion?  ("Simon Kinsella" <simon@bluefiresystems.co.uk>)
Список pgsql-sql
On Wed, Mar 01, 2006 at 01:30:23PM -0000, Simon Kinsella wrote:
> I'm trying to achieve this with a BEFORE DELETE trigger, which would set the
> 'marked_for_deletion' field to TRUE before attempting the delete proper.
> Then if the DELETE fails the row would still be tagged and I'd be happy.
> Problem is, when the DELETE operation fails with a RESTRICT VIOLATION error
> the entire operation is rolled back, including the BEFORE triggers, leaving
> me back where I started.

Yes.  In 8.1, you could use a subtransaction for the DELETE, which I
think would allow you to rollback at that point and still leave the
UPDATE in place.

A


-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The fact that technology doesn't work is no bar to success in the marketplace.    --Philip Greenspun


В списке pgsql-sql по дате отправления:

Предыдущее
От: Bryce Nesbitt
Дата:
Сообщение: Replication - state of the art?
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Replication - state of the art?