On 11 May 2011 19:51, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Peter Eisentraut <pete...@gmx.net> writes:
>> Why not?  Is there a fundamental problem, or just that no one wanted to
>> make it work?
>

More the latter really. I think they're very useful on views, but I
couldn't think of a use-case for having them on tables. ISTM that
anything an INSTEAD OF trigger on a table could do, could equally well
be done in a BEFORE trigger.

(BTW, the current behaviour is per SQL spec.)


> I'm fairly sure there was a substantive issue, but memory fails as to
> what it was.  You could try removing the error check and see what
> breaks ...
>

The first thing that would break is the Assert that checks oldtuple
(for UPDATE/DELETE), since the 'wholerow' attribute that INSTEAD OF
triggers rely on isn't built for a table. This is probably fixable,
I'm just not convinced that it's worth it.

If we did support INSTEAD OF triggers on tables, we would also need to
decide how they interact with BEFORE/AFTER triggers - do they fire in
between them, or do they replace them? I could see arguments for
either behaviour.

Regards,
Dean

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to