pgsql: Various cleanups for REFRESH MATERIALIZED VIEW CONCURRENTLY.

From: Kevin Grittner <kgrittn(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Various cleanups for REFRESH MATERIALIZED VIEW CONCURRENTLY.
Date: 2013-08-05 14:59:32
Message-ID: E1V6MFw-0002sJ-7u@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Various cleanups for REFRESH MATERIALIZED VIEW CONCURRENTLY.

Open and lock each index before checking definition in RMVC. The
ExclusiveLock on the related table is not viewed as sufficient to
ensure that no changes are made to the index definition, and
invalidation messages from other backends might have been missed.
Additionally, use RelationGetIndexExpressions() and check for NIL
rather than doing our own loop.

Protect against redefinition of tid and rowvar operators in RMVC.
While working on this, noticed that the fixes for bugs found during
the CF made the UPDATE statement useless, since no rows could
qualify for that treatment any more. Ripping out code to support
the UPDATE statement simplified the operator cleanups.

Change slightly confusing local field name.

Use meaningful alias names on queries in refresh_by_match_merge().

Per concerns of raised by Andres Freund and comments and
suggestions from Noah Misch. Some additional issues remain, which
will be addressed separately.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/841c29c8b3be98ee30486ee245ebee782d4dedd4

Modified Files
--------------
src/backend/commands/matview.c | 113 ++++++++++++----------------------------
1 file changed, 34 insertions(+), 79 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Kevin Grittner 2013-08-05 15:37:57 Re: [COMMITTERS] pgsql: Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY.
Previous Message Tom Lane 2013-08-03 16:41:10 pgsql: Make sure float4in/float8in accept all standard spellings of "in