Re: refresh materialized view concurrently

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: refresh materialized view concurrently
Date: 2013-06-17 11:13:20
Message-ID: 51BEEF50.5040709@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.06.2013 19:05, Kevin Grittner wrote:
> Attached is a patch for REFRESH MATERIALIZED VIEW CONCURRENTLY for
> 9.4 CF1. The goal of this patch is to allow a refresh without
> interfering with concurrent reads, using transactional semantics.
>
> It is my hope to get this committed during this CF to allow me to
> focus on incremental maintenance for the rest of the release cycle.

I must say this seems a bit pointless on its own. But if it's a stepping
stone to incremental maintenance, I have no objections.

> I didn't need to touch very much outside of matview-specific files
> for this. My biggest concern is that I needed two small functions
> which did *exactly* what some static functions in ri_triggers.c
> were doing and couldn't see where the best place to share them from
> was. For the moment I just duplicated them, but my hope would be
> that they could be put in a suitable location and called from both
> places, rather than duplicating the 30-some lines of code. The
> function signatures are:
>
> void quoteOneName(char *buffer, const char *name)
> void quoteRelationName(char *buffer, Relation rel)

I'd just use quote_identifier and quote_qualified_identifier instead.

I didn't understand this error message:

+ if (!foundUniqueIndex)
+ ereport(ERROR,
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("concurrent refresh requires a unique index on just
columns for all rows of the materialized view")));
+

What does that mean?

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-06-17 11:48:52 Re: Patch for fail-back without fresh backup
Previous Message Dean Rasheed 2013-06-17 10:34:52 Re: MD5 aggregate