postgresql/src
Tom Lane 411e2b0d59 In pg_dump, ensure that view triggers are processed after view rules.
If a view is split into CREATE TABLE + CREATE RULE to break a circular
dependency, then any triggers on the view must be dumped/reloaded after
the CREATE RULE; else the backend may reject the CREATE TRIGGER because
it's the wrong type of trigger for a plain table.  This works all right
in plain dump/restore because of pg_dump's sorting heuristic that places
triggers after rules.  However, when using parallel restore, the ordering
must be enforced by a dependency --- and we didn't have one.

Fixing this is a mere matter of adding an addObjectDependency() call,
except that we need to be able to find all the triggers belonging to the
view relation, and there was no easy way to do that.  Add fields to
pg_dump's TableInfo struct to remember where the associated TriggerInfo
struct(s) are.

Per bug report from Dennis Kögel.  The failure can be exhibited at least
as far back as 9.1, so back-patch to all supported branches.
2016-02-04 00:26:10 -05:00
..
backend Fix IsValidJsonNumber() to notice trailing non-alphanumeric garbage. 2016-02-03 01:39:08 -05:00
bin In pg_dump, ensure that view triggers are processed after view rules. 2016-02-04 00:26:10 -05:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
include Fix pg_description entries for jsonb_to_record() and jsonb_to_recordset(). 2016-02-02 11:39:50 -05:00
interfaces Fix out-of-memory error handling in ParameterDescription message processing. 2015-12-14 18:40:51 +02:00
makefiles Consolidate makefile code for setting top_srcdir, srcdir and VPATH. 2015-07-30 20:49:22 -04:00
pl Avoid dump/reload problems when using both plpython2 and plpython3. 2016-01-11 19:55:40 -05:00
port Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:22:39 -05:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:35 -04:00
test Clean up code for widget_in() and widget_out(). 2016-01-09 13:44:27 -05:00
timezone Update time zone data files to tzdata release 2015g. 2015-10-02 19:15:57 -04:00
tools Properly install dynloader.h on MSVC builds 2016-01-19 23:30:29 -05: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 Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Back-patch fixes to make TAP tests work on Windows. 2015-11-17 14:10:24 -05:00
Makefile.shlib Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00