forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdc42602
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 parente101878 commitdc42602
1 file changed
+15
-9
lines changedLines changed: 15 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
844 | 844 |
| |
845 | 845 |
| |
846 | 846 |
| |
847 |
| - | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
848 | 852 |
| |
849 | 853 |
| |
850 |
| - | |
851 |
| - | |
| 854 | + | |
852 | 855 |
| |
853 | 856 |
| |
854 |
| - | |
855 |
| - | |
856 | 857 |
| |
857 | 858 |
| |
858 |
| - | |
859 |
| - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
860 | 867 |
| |
861 | 868 |
| |
862 | 869 |
| |
| |||
1038 | 1045 |
| |
1039 | 1046 |
| |
1040 | 1047 |
| |
1041 |
| - | |
1042 |
| - | |
| 1048 | + | |
1043 | 1049 |
| |
1044 | 1050 |
| |
1045 | 1051 |
| |
|
0 commit comments
Comments
(0)