pgsql: In pg_dump, ensure that view triggers are processed after view r

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: In pg_dump, ensure that view triggers are processed after view r
Дата
Msg-id E1aRCR7-0003Pf-1y@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4f58a70039f68ecf46635636ad4929c3019a245e

Modified Files
--------------
src/bin/pg_dump/pg_dump.c      | 3 +++
src/bin/pg_dump/pg_dump.h      | 2 ++
src/bin/pg_dump/pg_dump_sort.c | 4 ++++
3 files changed, 9 insertions(+)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Extend sortsupport for text to more opclasses.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: In pg_dump, ensure that view triggers are processed after view r