forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbb584e8
committed
Fix dependency of partitioned table and table AM with CREATE TABLE .. USING
A pg_depend entry between a partitioned table and its table accessmethod was missing when using CREATE TABLE .. USING with an unpinnedaccess method. DROP ACCESS METHOD could be used, while it should beblocked if CASCADE is not specified, even if there was a partitionedtable that depends on the table access method. pg_class.relam wouldthen hold an orphaned OID value still pointing to the AM dropped.The problem is fixed by adding a dependency between the partitionedtable and its table access method if set when the relation is created.A test checking the contents of pg_depend in this case is added.Issue introduced in374c7a2, that has added support for CREATETABLE .. USING for partitioned tables.Reviewed-by: Alexander LakhinDiscussion:https://postgr.es/m/18674-1ef01eceec278fab@postgresql.orgBackpatch-through: 171 parente631ed8 commitbb584e8
File tree
3 files changed
+28
-2
lines changed- src
- backend/catalog
- test/regress
- expected
- sql
3 files changed
+28
-2
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1470 | 1470 |
| |
1471 | 1471 |
| |
1472 | 1472 |
| |
1473 |
| - | |
| 1473 | + | |
| 1474 | + | |
1474 | 1475 |
| |
1475 |
| - | |
| 1476 | + | |
| 1477 | + | |
1476 | 1478 |
| |
1477 | 1479 |
| |
1478 | 1480 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
343 | 343 |
| |
344 | 344 |
| |
345 | 345 |
| |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
346 | 360 |
| |
347 | 361 |
| |
348 | 362 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
217 | 217 |
| |
218 | 218 |
| |
219 | 219 |
| |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
220 | 230 |
| |
221 | 231 |
| |
222 | 232 |
| |
|
0 commit comments
Comments
(0)