From: Kevin Grittner <kgrittn@ymail.com>
To: shaunc@factfiber.com <shaunc@factfiber.com>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #8655: pg_restore problems with materialized views
Date: Wed, 4 Dec 2013 11:25:38 -0800 (PST)
Message-ID: <1386185138.72693.YahooMailNeo@web162901.mail.bf1.yahoo.com> (raw)
In-Reply-To: <E1Vo6cz-0004Pf-DN@wrigleys.postgresql.org>
References: <E1Vo6cz-0004Pf-DN@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
"shaunc@factfiber.com" <shaunc@factfiber.com> wrote:
> I have a large database (100s of millions of rows) in which there
> are many "chained" materialized views -- that is: some depend on
> others, etc...
>
> When I back up and then restore, only the "first layer" of views
> are refreshed. I can then go back and manually restore missing
> views with "-t"
> -- though if I do too many at once the same thing happens.
>
> I have tried to generate a small test case, but with no luck.
Yeah, it should work, and I have run a lot of test cases without
seeing this. The one case that is a little weird is when you
populate a materialized view "b" which references materialized view
"a", REFRESH MATERIALIZED VIEW "a" WITH NO DATA, and then dump.
> I suspect that pg_restore needs to issue "refresh" before it
> creates successive views, and in "small" cases it gets that right
> -- but there is some arbitrariness in the order that trips it up
> in sufficiently complex cases.
That does sound likely, but without a failing case, it is going to
be hard to diagnose.
> I also have indexes defined on the materialized views. I don't
> know if that matters -- an extra sequencing problem for restore
> though.
Those are all supposed to be handled, but if there is an
unidentified bug, who knows what matters?
Have you tried restoring a schema-only dump and populating it with
minimal data, and seeing whether you can replicate it that way?
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: kgrittn@ymail.com, shaunc@factfiber.com
Subject: Re: BUG #8655: pg_restore problems with materialized views
In-Reply-To: <1386185138.72693.YahooMailNeo@web162901.mail.bf1.yahoo.com>
References: <E1Vo6cz-0004Pf-DN@wrigleys.postgresql.org> <1386185138.72693.YahooMailNeo@web162901.mail.bf1.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox