forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commited74309
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 parent6c1b71b commited74309
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 | |
---|---|---|---|
| |||
3808 | 3808 |
| |
3809 | 3809 |
| |
3810 | 3810 |
| |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
3811 | 3819 |
| |
3812 | 3820 |
| |
3813 | 3821 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3911 | 3911 |
| |
3912 | 3912 |
| |
3913 | 3913 |
| |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
3914 | 3923 |
| |
3915 |
| - | |
3916 | 3924 |
| |
3917 | 3925 |
| |
3918 | 3926 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2413 | 2413 |
| |
2414 | 2414 |
| |
2415 | 2415 |
| |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
2416 | 2423 |
| |
2417 | 2424 |
| |
2418 | 2425 |
| |
|
0 commit comments
Comments
(0)