- Notifications
You must be signed in to change notification settings - Fork5
Commitf73bed3
committed
Repair a longstanding bug in CLUSTER and the rewriting variants of ALTER
TABLE: if the command is executed by someone other than the table owner (eg,a superuser) and the table has a toast table, the toast table's pg_type rowends up with the wrong typowner, ie, the command issuer not the table owner.This is quite harmless for most purposes, since no interesting permissionschecks consult the pg_type row. However, it could lead to unexpected failuresif one later tries to drop the role that issued the command (in 8.1 or 8.2),or strange warnings from pg_dump afterwards (in 8.3 and up, which will allowthe DROP ROLE because we don't create a "redundant" owner dependency for tablerowtypes). Problem identified by Cott Lang.Back-patch to 8.1. The problem is actually far older --- the CLUSTER variantcan be demonstrated in 7.0 --- but it's mostly cosmetic before 8.1 because wedidn't track ownership dependencies before 8.1. Also, fixing it before 8.1would require changing the call signature of heap_create_with_catalog(), whichseems to carry a nontrivial risk of breaking add-on modules.1 parent7de7876 commitf73bed3
File tree
5 files changed
+28
-14
lines changed- src
- backend
- catalog
- commands
- include/catalog
5 files changed
+28
-14
lines changedLines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
| 82 | + | |
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| |||
784 | 785 |
| |
785 | 786 |
| |
786 | 787 |
| |
| 788 | + | |
787 | 789 |
| |
788 | 790 |
| |
789 | 791 |
| |
| |||
792 | 794 |
| |
793 | 795 |
| |
794 | 796 |
| |
| 797 | + | |
795 | 798 |
| |
796 | 799 |
| |
797 | 800 |
| |
| |||
955 | 958 |
| |
956 | 959 |
| |
957 | 960 |
| |
| 961 | + | |
958 | 962 |
| |
959 | 963 |
| |
960 | 964 |
| |
| |||
971 | 975 |
| |
972 | 976 |
| |
973 | 977 |
| |
| 978 | + | |
974 | 979 |
| |
975 | 980 |
| |
976 | 981 |
| |
|
Lines changed: 8 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
| 50 | + | |
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
90 |
| - | |
| 90 | + | |
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
| |||
134 | 134 |
| |
135 | 135 |
| |
136 | 136 |
| |
137 |
| - | |
| 137 | + | |
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
| |||
173 | 173 |
| |
174 | 174 |
| |
175 | 175 |
| |
| 176 | + | |
176 | 177 |
| |
177 | 178 |
| |
178 | 179 |
| |
| |||
310 | 311 |
| |
311 | 312 |
| |
312 | 313 |
| |
313 |
| - | |
| 314 | + | |
314 | 315 |
| |
315 | 316 |
| |
316 | 317 |
| |
| |||
380 | 381 |
| |
381 | 382 |
| |
382 | 383 |
| |
383 |
| - | |
| 384 | + | |
384 | 385 |
| |
385 | 386 |
| |
386 | 387 |
| |
| |||
426 | 427 |
| |
427 | 428 |
| |
428 | 429 |
| |
429 |
| - | |
| 430 | + | |
430 | 431 |
| |
431 | 432 |
| |
432 | 433 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
144 | 144 |
| |
145 | 145 |
| |
146 | 146 |
| |
147 |
| - | |
| 147 | + | |
148 | 148 |
| |
149 | 149 |
| |
150 | 150 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
202 |
| - | |
| 202 | + | |
203 | 203 |
| |
204 | 204 |
| |
205 | 205 |
| |
| |||
536 | 536 |
| |
537 | 537 |
| |
538 | 538 |
| |
| 539 | + | |
539 | 540 |
| |
540 | 541 |
| |
541 | 542 |
| |
| |||
574 | 575 |
| |
575 | 576 |
| |
576 | 577 |
| |
| 578 | + | |
577 | 579 |
| |
578 | 580 |
| |
579 | 581 |
| |
| |||
1018 | 1020 |
| |
1019 | 1021 |
| |
1020 | 1022 |
| |
| 1023 | + | |
1021 | 1024 |
| |
1022 | 1025 |
| |
1023 | 1026 |
| |
| |||
1131 | 1134 |
| |
1132 | 1135 |
| |
1133 | 1136 |
| |
| 1137 | + | |
1134 | 1138 |
| |
1135 | 1139 |
| |
1136 | 1140 |
| |
| |||
1169 | 1173 |
| |
1170 | 1174 |
| |
1171 | 1175 |
| |
| 1176 | + | |
1172 | 1177 |
| |
1173 | 1178 |
| |
1174 | 1179 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 |
| |
22 | 24 |
| |
23 | 25 |
| |
24 | 26 |
| |
25 | 27 |
| |
26 | 28 |
| |
| 29 | + | |
27 | 30 |
| |
28 | 31 |
| |
29 | 32 |
| |
|
0 commit comments
Comments
(0)