Re: a row not deletes

From: Rafał Pietrak <rafal(at)ztk-rp(dot)eu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: a row not deletes
Date: 2014-04-27 15:21:48
Message-ID: 535D208C.3050102@ztk-rp.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thenx for explanations.

W dniu 27.04.2014 16:56, David G Johnston pisze:
> Andres Freund-3 wrote
>> Hi,
>>
>> On 2014-04-27 10:23:18 +0200, Rafał Pietrak wrote:
>>> I've just experienced an unexpected (for me) "loss" of DELETE. Is this a
>>> feature or a bug (postgres v.s. SQL)?
>> I guess you're using 9.2 or older? You are not allowed to update the
>> deleted row in a BEFORE trigger. The source has this comment about it
>> (in 9.3 onwards):

I'm using 9.1 (as of debian wheezy)

> IOW, it is a bug discovered during the 9.2 release that was deemed improper
> to back-patch.
>
> However, the bug applies to behavior that should only happen by mistake; you
> should not have a trigger that updates the row you are currently deleting.

Hmmm. I was just exersising it, as the most "elegant" resolve to my case:
1. I have a shopping chart with items
2. which (conditionally) turns into an invoice on chart deletion.
3. the assumption is: the chart is not very rigouroiusly checked during
its lifetime.
4. but the invoice have to .... so some "cleanup" is due just before an
item is deleted from the chart.

But, I understand that as of now, I cannot do that by "trigger
avalanche" :(

-R

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dorian Hoxha 2014-04-27 19:31:42 Postgresql the right tool (queue using advisory_locks + long transactions)
Previous Message David G Johnston 2014-04-27 14:56:40 Re: a row not deletes