Re: Materialized views WIP patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Materialized views WIP patch
Date
Msg-id 27998.1361360622@sss.pgh.pa.us
Whole thread Raw
In response to Re: Materialized views WIP patch  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Feb 19, 2013 at 11:01 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
>> This might be different if there were a command to refresh all
>> materialized views, because you don't want to have to go around and type
>> separate commands 47 times after a restore.

> Well, it's pretty easy to do:

> SELECT 'LOAD MATERIALIZED VIEW ' || p.oid::regclass || ';' FROM
> pg_class WHERE relkind = 'm';

> ...but we could also add explicit syntax for it, perhaps along the
> lines of what we have for CLUSTER and VACUUM.

It's not really that easy, because of the likelihood that MVs have to be
refreshed in a specific order.  The SELECT you suggest definitely seems
too simplistic.  A dedicated command could perhaps be built to pay
attention to dependencies ... but if we're still coding such things now,
it seems a bit late for 9.3.
        regards, tom lane



pgsql-hackers by date:

Previous
From: "pierpaolo.cincilla"
Date:
Subject: Re: PostgreSql - access modified rows in prepare transaction command
Next
From: "Etsuro Fujita"
Date:
Subject: Re: Review : Add hooks for pre- and post-processor executables for COPY and \copy