Re: New Event Trigger: table_rewrite

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: New Event Trigger: table_rewrite
Дата
Msg-id CA+TgmoZ7HxOdR4_VKYvQvD1bJO1UXw+XaDVhr=x6fZjZ1zM6GA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: New Event Trigger: table_rewrite  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On Tue, Nov 18, 2014 at 5:34 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Almost the whole of that function is conditions to bail out clustering
> the relation if things have changed since the relation list was
> collected.  It seems wrong to invoke the event trigger in all those
> cases; it's going to fire spuriously.  I think you should move the
> invocation of the event trigger at the end, just before rebuild_relation
> is called.  Not sure where relative to the predicate lock stuff therein;
> probably before, so that we avoid doing that dance if the event trigger
> function decides to jump ship.

I can see two problems with that:

1. What if the conditions aren't true any more after the event trigger
has run?  Then it's unsafe.

2. If we do it that way, then we'll unnecessarily wait for a lock on
the relation even if the event trigger is just going to bail out.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: New Event Trigger: table_rewrite
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Increasing test coverage of WAL redo functions