postgresql/src
Tom Lane 2f93b74bf3 Fix dumping of matviews with indirect dependencies on primary keys.
Commit 62215de29 turns out to have been not quite on-the-mark.
When we are forced to postpone dumping of a materialized view into
the dump's post-data section (because it depends on a unique index
that isn't created till that section), we may also have to postpone
dumping other matviews that depend on said matview.  The previous fix
didn't reliably work for such cases: it'd break the dependency loops
properly, producing a workable object ordering, but it didn't
necessarily mark all the matviews as "postponed_def".  This led to
harmless bleating about "archive items not in correct section order",
as reported by Tom Cassidy in bug #15602.  Less harmlessly,
selective-restore options such as --section might misbehave due to
the matview dump objects not being properly labeled.

The right way to fix it is to consider that each pre-data dependency
we break amounts to moving the no-longer-dependent object into
post-data, and hence we should mark that object if it's a matview.

Back-patch to all supported versions, since the issue's been there
since matviews were introduced.

Discussion: https://postgr.es/m/15602-e895445f73dc450b@postgresql.org
2019-02-04 17:20:02 -05:00
..
backend Avoid possible deadlock while locking multiple heap pages. 2019-02-02 15:43:58 +05:30
bin Fix dumping of matviews with indirect dependencies on primary keys. 2019-02-04 17:20:02 -05:00
common Fix portability failure introduced in commits d2b0b60e7 et al. 2018-12-26 15:30:40 -05:00
include Fix misc typos in comments. 2019-01-23 13:47:05 +02:00
interfaces Remove infinite-loop hazards in ecpg test suite. 2019-01-24 16:46:56 -05:00
makefiles Add PG_CFLAGS, PG_CXXFLAGS, and PG_LDFLAGS variables to PGXS 2019-02-03 17:49:04 +09:00
pl Fix misc typos in comments. 2019-01-23 13:47:05 +02:00
port Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Allow UNLISTEN in hot-standby mode. 2019-01-25 21:14:31 -05:00
timezone Sync our copy of the timezone library with IANA release tzcode2018g. 2018-10-31 09:48:24 -04:00
tools Revert "Add valgrind suppressions for wcsrtombs optimizations" 2019-01-19 20:36:07 +01:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in fix typo 2019-01-13 16:44:31 -05:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00