Commit 2868b0c
committed
Ensure an index that uses a whole-row Var still depends on its table.
We failed to record any dependency on the underlying table for an index
declared like "create index i on t (foo(t.*))". This would create trouble
if the table were dropped without previously dropping the index. To fix,
simplify some overly-cute code in index_create(), accepting the possibility
that sometimes the whole-table dependency will be redundant. Also document
this hazard in dependency.c. Per report from Kevin Grittner.
In passing, prevent a core dump in pg_get_indexdef() if the index's table
can't be found. I came across this while experimenting with Kevin's
example. Not sure it's a real issue when the catalogs aren't corrupt, but
might as well be cautious.
Back-patch to all supported versions.1 parent c0486e9 commit 2868b0c
File tree
3 files changed
+40
-14
lines changed- src/backend
- catalog
- utils/adt
3 files changed
+40
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
893 | 899 | | |
894 | 900 | | |
895 | 901 | | |
| |||
998 | 1004 | | |
999 | 1005 | | |
1000 | 1006 | | |
1001 | | - | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
1002 | 1015 | | |
1003 | 1016 | | |
1004 | 1017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
689 | 688 | | |
690 | 689 | | |
691 | 690 | | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
698 | 695 | | |
699 | | - | |
700 | | - | |
701 | | - | |
| 696 | + | |
702 | 697 | | |
703 | 698 | | |
704 | 699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
724 | | - | |
| 725 | + | |
725 | 726 | | |
726 | 727 | | |
727 | 728 | | |
| |||
1092 | 1093 | | |
1093 | 1094 | | |
1094 | 1095 | | |
1095 | | - | |
| 1096 | + | |
1096 | 1097 | | |
1097 | 1098 | | |
1098 | 1099 | | |
| |||
4329 | 4330 | | |
4330 | 4331 | | |
4331 | 4332 | | |
4332 | | - | |
| 4333 | + | |
4333 | 4334 | | |
4334 | 4335 | | |
4335 | 4336 | | |
| |||
4840 | 4841 | | |
4841 | 4842 | | |
4842 | 4843 | | |
| 4844 | + | |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
| 4852 | + | |
| 4853 | + | |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
| 4859 | + | |
| 4860 | + | |
4843 | 4861 | | |
4844 | 4862 | | |
4845 | 4863 | | |
| |||
0 commit comments