Re: refresh materialized view concurrently - Mailing list pgsql-hackers

From Tom Lane
Subject Re: refresh materialized view concurrently
Date
Msg-id 17005.1372861543@sss.pgh.pa.us
Whole thread Raw
In response to Re: refresh materialized view concurrently  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-hackers
Kevin Grittner <kgrittn@ymail.com> writes:
> Robert Haas <robertmhaas@gmail.com> wrote:
>> I doubt very much that this is safe.� And even if it is safe
>> today, I think it's a bad idea, because we're likely to try to
>> reduce lock levels in the future.� Taking no lock on a relation
>> we're opening, even an index, seems certain to be a bad idea.

I'm with Robert on this.

> What we're talking about is taking a look at the index definition
> while the indexed table involved is covered by an ExclusiveLock.
> Why is that more dangerous than inserting entries into an index
> without taking a lock on that index while the indexed table is
> covered by a RowExclusiveLock, as happens on INSERT? 

I don't believe that that happens.  If it does, it's a bug.  Either the
planner or the executor should be taking a lock on each index touched
by a query.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: refresh materialized view concurrently
Next
From: Robert Haas
Date:
Subject: Re: New regression test time