Re: Allow WHEN in INSTEAD OF triggers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Allow WHEN in INSTEAD OF triggers
Date
Msg-id 16007.1577503755@sss.pgh.pa.us
Whole thread Raw
In response to Allow WHEN in INSTEAD OF triggers  (David Fetter <david@fetter.org>)
Responses Re: Allow WHEN in INSTEAD OF triggers
List pgsql-hackers
David Fetter <david@fetter.org> writes:
> While noodling around with an upcoming patch to remove user-modifiable
> RULEs, I noticed that WHEN conditions were disallowed from INSTEAD OF
> triggers for no discernible reason. This patch removes that
> restriction.

This seems like a remarkably bad idea.  The point of an INSTEAD OF
trigger is that it is guaranteed to handle the operation.  What's
the system supposed to do with rows the trigger doesn't handle?

I notice that your patch doesn't even bother to test what happens,
but I'd argue that whatever it is, it's wrong.  If you think that
"do nothing" or "throw an error" is appropriate, you can code that
inside the trigger.  It's not PG's charter to make such a decision.

            regards, tom lane

PS: I think your chances of removing rules are not good, either.



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Allow WHEN in INSTEAD OF triggers
Next
From: John Naylor
Date:
Subject: Re: use CLZ instruction in AllocSetFreeIndex()