forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit62215de
committed
Fix dumping of a materialized view that depends on a table's primary key.
It is possible for a view or materialized view to depend on a table'sprimary key, if the view query relies on functional dependency toabbreviate a GROUP BY list. This is problematic for pg_dump since weordinarily want to dump view definitions in the pre-data section butindexes in post-data. pg_dump knows how to deal with this situation forregular views, by breaking the view's ON SELECT rule apart from the viewproper. But it had not been taught what to do about materialized views,and in fact mistakenly dumped them as regular views in such cases, asseen in bug #9616 from Jesse Denardo.If we had CREATE OR REPLACE MATERIALIZED VIEW, we could fix this in amanner analogous to what's done for regular views; but we don't yet,and we'd not back-patch such a thing into 9.3 anyway. As a hopefully-temporary workaround, break the circularity by postponing the matviewinto post-data altogether when this case occurs.1 parent8f5578d commit62215de
3 files changed
+67
-7
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4796 | 4796 |
| |
4797 | 4797 |
| |
4798 | 4798 |
| |
| 4799 | + | |
| 4800 | + | |
4799 | 4801 |
| |
4800 | 4802 |
| |
4801 | 4803 |
| |
| |||
13611 | 13613 |
| |
13612 | 13614 |
| |
13613 | 13615 |
| |
13614 |
| - | |
| 13616 | + | |
| 13617 | + | |
13615 | 13618 |
| |
13616 | 13619 |
| |
13617 | 13620 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
241 | 241 |
| |
242 | 242 |
| |
243 | 243 |
| |
244 |
| - | |
| 244 | + | |
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
| |||
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
257 |
| - | |
| 257 | + | |
258 | 258 |
| |
259 | 259 |
| |
| 260 | + | |
260 | 261 |
| |
261 | 262 |
| |
262 | 263 |
| |
|
Lines changed: 60 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
798 | 798 |
| |
799 | 799 |
| |
800 | 800 |
| |
| 801 | + | |
801 | 802 |
| |
802 | 803 |
| |
803 | 804 |
| |
| |||
814 | 815 |
| |
815 | 816 |
| |
816 | 817 |
| |
817 |
| - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
818 | 821 |
| |
819 | 822 |
| |
820 | 823 |
| |
| |||
841 | 844 |
| |
842 | 845 |
| |
843 | 846 |
| |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
844 | 871 |
| |
845 | 872 |
| |
846 | 873 |
| |
| |||
956 | 983 |
| |
957 | 984 |
| |
958 | 985 |
| |
959 |
| - | |
| 986 | + | |
960 | 987 |
| |
961 | 988 |
| |
962 | 989 |
| |
| 990 | + | |
| 991 | + | |
963 | 992 |
| |
964 | 993 |
| |
965 | 994 |
| |
| |||
970 | 999 |
| |
971 | 1000 |
| |
972 | 1001 |
| |
| 1002 | + | |
| 1003 | + | |
973 | 1004 |
| |
974 | 1005 |
| |
975 | 1006 |
| |
| |||
978 | 1009 |
| |
979 | 1010 |
| |
980 | 1011 |
| |
981 |
| - | |
| 1012 | + | |
982 | 1013 |
| |
983 | 1014 |
| |
984 | 1015 |
| |
985 | 1016 |
| |
986 |
| - | |
| 1017 | + | |
| 1018 | + | |
987 | 1019 |
| |
988 | 1020 |
| |
989 | 1021 |
| |
| |||
1000 | 1032 |
| |
1001 | 1033 |
| |
1002 | 1034 |
| |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1003 | 1059 |
| |
1004 | 1060 |
| |
1005 | 1061 |
| |
|
0 commit comments
Comments
(0)