From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix dumping of a materialized view that depends on a table's pri |
Date: | 2014-03-29 21:34:14 |
Message-ID: | E1WU0tK-0000J6-Bs@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix dumping of a materialized view that depends on a table's primary key.
It is possible for a view or materialized view to depend on a table's
primary key, if the view query relies on functional dependency to
abbreviate a GROUP BY list. This is problematic for pg_dump since we
ordinarily want to dump view definitions in the pre-data section but
indexes in post-data. pg_dump knows how to deal with this situation for
regular views, by breaking the view's ON SELECT rule apart from the view
proper. But it had not been taught what to do about materialized views,
and in fact mistakenly dumped them as regular views in such cases, as
seen in bug #9616 from Jesse Denardo.
If we had CREATE OR REPLACE MATERIALIZED VIEW, we could fix this in a
manner analogous to what's done for regular views; but we don't yet,
and we'd not back-patch such a thing into 9.3 anyway. As a hopefully-
temporary workaround, break the circularity by postponing the matview
into post-data altogether when this case occurs.
Branch
------
REL9_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/3080bbaa919143e19dbe65fd0d81a1b4457c845d
Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 5 +++-
src/bin/pg_dump/pg_dump.h | 3 +-
src/bin/pg_dump/pg_dump_sort.c | 64 +++++++++++++++++++++++++++++++++++++---
3 files changed, 66 insertions(+), 6 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2014-03-29 21:39:11 | Re: pgsql: Revert "Secure Unix-domain sockets of "make check" temporary clu |
Previous Message | Andrew Dunstan | 2014-03-29 21:21:11 | Re: pgsql: Revert "Secure Unix-domain sockets of "make check" temporary clu |