Commit a30531c
committed
Fix "unexpected relkind" error when denying permissions on toast tables.
get_relkind_objtype, and hence get_object_type, failed when applied to a
toast table. This is not a good thing, because it prevents reporting of
perfectly legitimate permissions errors. (At present, these functions
are in fact *only* used to determine the ObjectType argument for
acl_error() calls.) It seems best to have them fall back to returning
OBJECT_TABLE in every case where they can't determine an object type
for a pg_class entry, so do that.
In passing, make some edits to alter.c to make it more obvious that
those calls of get_object_type() are used only for error reporting.
This might save a few cycles in the non-error code path, too.
Back-patch to v11 where this issue originated.
John Hsu, Michael Paquier, Tom Lane
Discussion: https://postgr.es/m/C652D3DF-2B0C-4128-9420-FB5379F6B1E4@amazon.com1 parent 529ebb2 commit a30531c
File tree
4 files changed
+42
-14
lines changed- src
- backend
- catalog
- commands
- test/regress
- expected
- sql
4 files changed
+42
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2612 | 2612 | | |
2613 | 2613 | | |
2614 | 2614 | | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
2615 | 2622 | | |
2616 | 2623 | | |
2617 | 2624 | | |
| |||
5333 | 5340 | | |
5334 | 5341 | | |
5335 | 5342 | | |
| 5343 | + | |
| 5344 | + | |
| 5345 | + | |
| 5346 | + | |
| 5347 | + | |
| 5348 | + | |
| 5349 | + | |
| 5350 | + | |
| 5351 | + | |
| 5352 | + | |
5336 | 5353 | | |
5337 | 5354 | | |
5338 | 5355 | | |
| |||
5352 | 5369 | | |
5353 | 5370 | | |
5354 | 5371 | | |
5355 | | - | |
5356 | | - | |
5357 | | - | |
5358 | | - | |
5359 | | - | |
| 5372 | + | |
| 5373 | + | |
5360 | 5374 | | |
5361 | | - | |
5362 | | - | |
| 5375 | + | |
| 5376 | + | |
5363 | 5377 | | |
5364 | 5378 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
| |||
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
227 | | - | |
| 226 | + | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
674 | 673 | | |
675 | 674 | | |
676 | 675 | | |
| |||
726 | 725 | | |
727 | 726 | | |
728 | 727 | | |
729 | | - | |
| 728 | + | |
730 | 729 | | |
731 | 730 | | |
732 | 731 | | |
| |||
950 | 949 | | |
951 | 950 | | |
952 | 951 | | |
953 | | - | |
954 | | - | |
955 | 952 | | |
956 | 953 | | |
957 | 954 | | |
| |||
970 | 967 | | |
971 | 968 | | |
972 | 969 | | |
973 | | - | |
| 970 | + | |
| 971 | + | |
974 | 972 | | |
975 | 973 | | |
976 | 974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2434 | 2434 | | |
2435 | 2435 | | |
2436 | 2436 | | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
2437 | 2445 | | |
2438 | 2446 | | |
| 2447 | + | |
2439 | 2448 | | |
2440 | 2449 | | |
2441 | 2450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1003 | 1003 | | |
1004 | 1004 | | |
1005 | 1005 | | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
1006 | 1012 | | |
1007 | 1013 | | |
1008 | 1014 | | |
| 1015 | + | |
1009 | 1016 | | |
1010 | 1017 | | |
0 commit comments