forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6e4d45b
committed
Fix dumping of matviews with indirect dependencies on primary keys.
Commit62215de turns out to have been not quite on-the-mark.When we are forced to postpone dumping of a materialized view intothe dump's post-data section (because it depends on a unique indexthat isn't created till that section), we may also have to postponedumping other matviews that depend on said matview. The previous fixdidn't reliably work for such cases: it'd break the dependency loopsproperly, producing a workable object ordering, but it didn'tnecessarily mark all the matviews as "postponed_def". This led toharmless 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 tothe matview dump objects not being properly labeled.The right way to fix it is to consider that each pre-data dependencywe break amounts to moving the no-longer-dependent object intopost-data, and hence we should mark that object if it's a matview.Back-patch to all supported versions, since the issue's been theresince matviews were introduced.Discussion:https://postgr.es/m/15602-e895445f73dc450b@postgresql.org1 parentf602cf4 commit6e4d45b
1 file changed
+15
-9
lines changedLines changed: 15 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
755 | 755 |
| |
756 | 756 |
| |
757 | 757 |
| |
758 |
| - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
759 | 763 |
| |
760 | 764 |
| |
761 |
| - | |
762 |
| - | |
| 765 | + | |
763 | 766 |
| |
764 | 767 |
| |
765 |
| - | |
766 |
| - | |
767 | 768 |
| |
768 | 769 |
| |
769 |
| - | |
770 |
| - | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
771 | 778 |
| |
772 | 779 |
| |
773 | 780 |
| |
| |||
956 | 963 |
| |
957 | 964 |
| |
958 | 965 |
| |
959 |
| - | |
960 |
| - | |
| 966 | + | |
961 | 967 |
| |
962 | 968 |
| |
963 | 969 |
| |
|
0 commit comments
Comments
(0)