forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd07afa4
committed
Rework internals of changing a type's ownership
This is necessary so that REASSIGN OWNED does the right thing withcomposite types, to wit, that it also alters ownership of the type'spg_class entry -- previously, the pg_class entry remained owned by theoriginal user, which caused later other failures such as the new owner'sinability to use ALTER TYPE to rename an attribute of the affectedcomposite. Also, if the original owner is later dropped, the pg_classentry becomes owned by a non-existant user which is bogus.To fix, create a new routine AlterTypeOwner_oid which knows whether topass the request to ATExecChangeOwner or deal with it directly, and usethat in shdepReassignOwner rather than calling AlterTypeOwnerInternaldirectly. AlterTypeOwnerInternal is now simpler in that it onlymodifies the pg_type entry and recurses to handle a possible array type;higher-level tasks are handled by either AlterTypeOwner directly orAlterTypeOwner_oid.I took the opportunity to add a few more objects to the test rig forREASSIGN OWNED, so that more cases are exercised. Additional ones couldbe added for superuser-only-ownable objects (such as FDWs and eventtriggers) but I didn't want to push my luck by adding a new superuser tothe tests on a backpatchable bug fix.Per bug #13666 reported by Chris Pacejo.This is a backpatch of commit756e7b4 to branches 9.1 -- 9.4.1 parent2c8ae64 commitd07afa4
File tree
6 files changed
+97
-73
lines changed- src
- backend
- catalog
- commands
- include/commands
- test/regress
- expected
- sql
6 files changed
+97
-73
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1350 | 1350 |
| |
1351 | 1351 |
| |
1352 | 1352 |
| |
1353 |
| - | |
| 1353 | + | |
1354 | 1354 |
| |
1355 | 1355 |
| |
1356 | 1356 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8641 | 8641 |
| |
8642 | 8642 |
| |
8643 | 8643 |
| |
8644 |
| - | |
8645 |
| - | |
| 8644 | + | |
8646 | 8645 |
| |
8647 | 8646 |
| |
8648 | 8647 |
| |
|
Lines changed: 47 additions & 66 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3315 | 3315 |
| |
3316 | 3316 |
| |
3317 | 3317 |
| |
3318 |
| - | |
3319 |
| - | |
3320 |
| - | |
3321 |
| - | |
3322 |
| - | |
3323 |
| - | |
3324 |
| - | |
3325 |
| - | |
3326 |
| - | |
3327 |
| - | |
3328 |
| - | |
3329 |
| - | |
3330 |
| - | |
3331 |
| - | |
3332 |
| - | |
3333 |
| - | |
3334 |
| - | |
3335 |
| - | |
| 3318 | + | |
| 3319 | + | |
3336 | 3320 |
| |
3337 |
| - | |
3338 |
| - | |
| 3321 | + | |
| 3322 | + | |
3339 | 3323 |
| |
3340 |
| - | |
3341 |
| - | |
3342 |
| - | |
3343 |
| - | |
3344 |
| - | |
3345 |
| - | |
3346 |
| - | |
3347 |
| - | |
3348 |
| - | |
3349 |
| - | |
3350 |
| - | |
3351 |
| - | |
| 3324 | + | |
| 3325 | + | |
3352 | 3326 |
| |
3353 |
| - | |
3354 |
| - | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
3355 | 3344 |
| |
3356 |
| - | |
| 3345 | + | |
3357 | 3346 |
| |
3358 |
| - | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
3359 | 3351 |
| |
3360 |
| - | |
3361 |
| - | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
3362 | 3361 |
| |
3363 |
| - | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
3364 | 3365 |
| |
3365 |
| - | |
3366 |
| - | |
3367 |
| - | |
3368 |
| - | |
3369 |
| - | |
| 3366 | + | |
3370 | 3367 |
| |
3371 |
| - | |
| 3368 | + | |
3372 | 3369 |
| |
3373 |
| - | |
3374 |
| - | |
3375 | 3370 |
| |
3376 | 3371 |
| |
3377 | 3372 |
| |
3378 |
| - | |
3379 |
| - | |
3380 |
| - | |
3381 |
| - | |
3382 |
| - | |
3383 |
| - | |
| 3373 | + | |
3384 | 3374 |
| |
3385 |
| - | |
3386 |
| - | |
3387 |
| - | |
3388 |
| - | |
| 3375 | + | |
| 3376 | + | |
3389 | 3377 |
| |
3390 | 3378 |
| |
3391 |
| - | |
3392 |
| - | |
| 3379 | + | |
3393 | 3380 |
| |
3394 | 3381 |
| |
3395 | 3382 |
| |
| |||
3434 | 3421 |
| |
3435 | 3422 |
| |
3436 | 3423 |
| |
3437 |
| - | |
3438 |
| - | |
3439 |
| - | |
3440 |
| - | |
3441 | 3424 |
| |
3442 | 3425 |
| |
3443 |
| - | |
3444 |
| - | |
3445 |
| - | |
| 3426 | + | |
3446 | 3427 |
| |
3447 | 3428 |
| |
3448 | 3429 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
47 |
| - | |
| 46 | + | |
| 47 | + | |
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
|
Lines changed: 28 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| 87 | + | |
87 | 88 |
| |
| 89 | + | |
88 | 90 |
| |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
89 | 97 |
| |
90 | 98 |
| |
91 | 99 |
| |
92 | 100 |
| |
93 | 101 |
| |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
94 | 112 |
| |
95 | 113 |
| |
96 | 114 |
| |
| |||
100 | 118 |
| |
101 | 119 |
| |
102 | 120 |
| |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
103 | 128 |
| |
104 | 129 |
| |
105 | 130 |
| |
106 |
| - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
107 | 134 |
| |
108 | 135 |
| |
109 | 136 |
| |
|
Lines changed: 18 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
77 | 78 |
| |
78 | 79 |
| |
| 80 | + | |
79 | 81 |
| |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 |
| |
81 | 89 |
| |
82 | 90 |
| |
83 | 91 |
| |
84 | 92 |
| |
85 | 93 |
| |
86 |
| - | |
87 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
88 | 102 |
| |
89 | 103 |
| |
90 | 104 |
| |
| 105 | + | |
| 106 | + | |
| 107 | + | |
91 | 108 |
| |
92 | 109 |
| |
93 | 110 |
| |
|
0 commit comments
Comments
(0)