forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbd5ddbe
committed
Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema
As coded, the code would use as a base comparison the namespace OID fromthe first object scanned in pg_depend when switching its namespacedependency entry to the new one, and use it as a base of comparison forany follow-up checks. It would also be used as the old namespace OID toswitch *from* for the extension's pg_depend entry. Hence, if the firstobject scanned has a namespace different than the one stored in theextension, we would finish by:- Not checking that the extension objects map with the extension'sschema.- Not switching the extension -> namespace dependency entry to the newnamespace provided by the user, making ALTER EXTENSION ineffective.This issue exists since this command has been introduced ind9572c4 forrelocatable extension, so backpatch all the way down to 11. The testcase has been provided by Heikki, that I have tweaked a bit to show theeffects on pg_depend for the extension.Reported-by: Heikki LinnakangasAuthor: Michael Paquier, Heikki LinnakangasDiscussion:https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fiBackpatch-through: 111 parent3c963d3 commitbd5ddbe
File tree
3 files changed
+79
-7
lines changed- src
- backend/commands
- test/modules/test_extensions
- expected
- sql
3 files changed
+79
-7
lines changedLines changed: 4 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2750 | 2750 |
| |
2751 | 2751 |
| |
2752 | 2752 |
| |
2753 |
| - | |
| 2753 | + | |
2754 | 2754 |
| |
2755 | 2755 |
| |
2756 | 2756 |
| |
| |||
2833 | 2833 |
| |
2834 | 2834 |
| |
2835 | 2835 |
| |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
2836 | 2839 |
| |
2837 | 2840 |
| |
2838 | 2841 |
| |
| |||
2912 | 2915 |
| |
2913 | 2916 |
| |
2914 | 2917 |
| |
2915 |
| - | |
2916 |
| - | |
2917 |
| - | |
2918 |
| - | |
2919 |
| - | |
2920 |
| - | |
2921 | 2918 |
| |
2922 | 2919 |
| |
2923 | 2920 |
| |
|
Lines changed: 43 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
312 | 312 |
| |
313 | 313 |
| |
314 | 314 |
| |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
315 | 358 |
| |
316 | 359 |
| |
317 | 360 |
| |
|
Lines changed: 32 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
210 | 210 |
| |
211 | 211 |
| |
212 | 212 |
| |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
213 | 245 |
| |
214 | 246 |
| |
215 | 247 |
| |
|
0 commit comments
Comments
(0)