forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf74fac0
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 parent547dd2c commitf74fac0
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 | |
---|---|---|---|
| |||
3518 | 3518 |
| |
3519 | 3519 |
| |
3520 | 3520 |
| |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
3521 | 3529 |
| |
3522 | 3530 |
| |
3523 | 3531 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3909 | 3909 |
| |
3910 | 3910 |
| |
3911 | 3911 |
| |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
3912 | 3921 |
| |
3913 |
| - | |
3914 | 3922 |
| |
3915 | 3923 |
| |
3916 | 3924 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2410 | 2410 |
| |
2411 | 2411 |
| |
2412 | 2412 |
| |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
2413 | 2420 |
| |
2414 | 2421 |
| |
2415 | 2422 |
| |
|
0 commit comments
Comments
(0)