postgresql/src/bin/pg_dump
Tom Lane 62215de292 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.
2014-03-29 17:34:00 -04:00
..
po Translation updates 2013-12-02 00:17:07 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
common.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
compress_io.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
compress_io.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
dumputils.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
dumputils.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
keywords.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
Makefile Update copyright for 2014 2014-01-07 16:05:30 -05:00
nls.mk Switch dependency order of libpgcommon and libpgport 2013-10-17 22:02:35 -04:00
parallel.c Avoid minor leak in parallel pg_dump 2014-01-24 15:10:08 -05:00
parallel.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_backup.h pg_dump et al: Add --if-exists option 2014-03-03 15:02:18 -03:00
pg_backup_archiver.c pg_dump et al: Add --if-exists option 2014-03-03 15:02:18 -03:00
pg_backup_archiver.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pg_backup_custom.c Focus on ftello result < 0 instead of errno 2014-02-09 13:29:36 -05:00
pg_backup_db.c Move some pg_dump function around. 2013-03-27 18:10:40 +02:00
pg_backup_db.h pg_dump: Further reduce reliance on global variables. 2012-02-07 10:07:02 -05:00
pg_backup_directory.c Remove MinGW readdir/errno bug workaround fixed on 2003-10-10 2014-03-21 13:47:37 -04:00
pg_backup_null.c Move some pg_dump function around. 2013-03-27 18:10:40 +02:00
pg_backup_tar.c Further pg_dump / ftello improvements 2014-02-09 18:28:14 -05:00
pg_backup_tar.h Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant. 2012-09-28 15:19:15 -04:00
pg_backup_utils.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_backup_utils.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_dump.c Fix dumping of a materialized view that depends on a table's primary key. 2014-03-29 17:34:00 -04:00
pg_dump.h Fix dumping of a materialized view that depends on a table's primary key. 2014-03-29 17:34:00 -04:00
pg_dump_sort.c Fix dumping of a materialized view that depends on a table's primary key. 2014-03-29 17:34:00 -04:00
pg_dumpall.c Fix pg_dumpall option parsing: -i doesn't take an argument. 2014-03-18 10:38:25 -04:00
pg_restore.c pg_dump et al: Add --if-exists option 2014-03-03 15:02:18 -03:00