Re: Triggers with DO functionality

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: Triggers with DO functionality
Дата
Msg-id CAA-aLv4HnOVvR+r1dQFPbbCa3=fDgyq45OKRbDp_Lxdeofte7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Triggers with DO functionality  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: Triggers with DO functionality  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On 16 September 2014 13:45, Andres Freund <andres@2ndquadrant.com> wrote:
On 2014-09-16 13:42:22 +0100, Thom Brown wrote:
> > > The function can't be the target of CREATE OR REPLACE FUNCTION.
> >
> > That *really* sucks. To the point of making the feature useless in my
> > eyes. That's really something frequently done.
> >
>
> Why not CREATE OR REPLACE TRIGGER?  Wouldn't the function itself be an
> internal matter rather than something for users to worry about?  If the
> user needs to adjust it, they'd need to discover the name of the function
> the trigger referred to, which may not be trivial.

Because CREATE OR REPLACE trigger has to take a heavy relation level
lock?  Because we don't have it? Because it'll allow to change things
that you really don't want to change?

Would CREATE OR REPLACE trigger need a heavy relational level lock if just the anonymous function body were changing?

My concern is mainly about us on one hand saying "Look, we've removed the need for trigger statements when creating triggers", then on the other saying "But if you want to change anything, treat it as if we hadn't done that, and you'll need to go find the function that we made in the background."

I guess if we were to do that, we would just need to make it clear that this is all syntactic sugar, and things like \d+ <table> output would show the trigger calling the "anonymous" function rather than showing the body of the function as part of the trigger.

--
Thom

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Triggers with DO functionality
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Triggers with DO functionality