Re: Tables cannot have INSTEAD OF triggers

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Tables cannot have INSTEAD OF triggers
Дата
Msg-id BANLkTi=A9b8Jkn7YDXqu5oY9eQnr8O8AaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Tables cannot have INSTEAD OF triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 11 May 2011 19:51, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter_e@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


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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Extension Packaging
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Fix for bug in ldapServiceLookup in libpq