forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit084814d
committed
Reset relhassubclass upon attaching table as a partition
We don't allow inheritance parents as partitions, and have checks toprevent this; but if a table _was_ in the past an inheritance parentsand all their children are removed, the pg_class.relhassubclass flagmay remain set, which confuses the partition pruning code (mostobviously, it results in an assertion failure; in production builds itmay be worse.)Fix by resetting relhassubclass on attach.Backpatch to all supported versions.Reported-by: Alexander Lakhin <exclusion@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/18550-d5e047e9a897a889@postgresql.org1 parenta57d168 commit084814d
File tree
3 files changed
+24
-1
lines changed- src
- backend/catalog
- test/regress
- expected
- sql
3 files changed
+24
-1
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3521 | 3521 |
| |
3522 | 3522 |
| |
3523 | 3523 |
| |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
3524 | 3532 |
| |
3525 | 3533 |
| |
3526 | 3534 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3917 | 3917 |
| |
3918 | 3918 |
| |
3919 | 3919 |
| |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
3920 | 3929 |
| |
3921 |
| - | |
3922 | 3930 |
| |
3923 | 3931 |
| |
3924 | 3932 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2416 | 2416 |
| |
2417 | 2417 |
| |
2418 | 2418 |
| |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
2419 | 2426 |
| |
2420 | 2427 |
| |
2421 | 2428 |
| |
|
0 commit comments
Comments
(0)