- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit411e2b0
committed
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 circulardependency, then any triggers on the view must be dumped/reloaded afterthe CREATE RULE; else the backend may reject the CREATE TRIGGER becauseit's the wrong type of trigger for a plain table. This works all rightin plain dump/restore because of pg_dump's sorting heuristic that placestriggers after rules. However, when using parallel restore, the orderingmust 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 theview relation, and there was no easy way to do that. Add fields topg_dump's TableInfo struct to remember where the associated TriggerInfostruct(s) are.Per bug report from Dennis Kögel. The failure can be exhibited at leastas far back as 9.1, so back-patch to all supported branches.1 parentc27fda6 commit411e2b0
3 files changed
+9
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5905 | 5905 |
| |
5906 | 5906 |
| |
5907 | 5907 |
| |
| 5908 | + | |
| 5909 | + | |
| 5910 | + | |
5908 | 5911 |
| |
5909 | 5912 |
| |
5910 | 5913 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
289 | 289 |
| |
290 | 290 |
| |
291 | 291 |
| |
| 292 | + | |
| 293 | + | |
292 | 294 |
| |
293 | 295 |
| |
294 | 296 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
878 | 878 |
| |
879 | 879 |
| |
880 | 880 |
| |
| 881 | + | |
881 | 882 |
| |
882 | 883 |
| |
883 | 884 |
| |
| |||
895 | 896 |
| |
896 | 897 |
| |
897 | 898 |
| |
| 899 | + | |
| 900 | + | |
| 901 | + | |
898 | 902 |
| |
899 | 903 |
| |
900 | 904 |
| |
|
0 commit comments
Comments
(0)