On Tue, Nov 18, 2014 at 5:34 PM, Alvaro Herrera
<alvhe...@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


-- 
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