forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2b22543
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 parent20aaa63 commit2b22543
File tree
3 files changed
+24
-1
lines changed- src
- backend/catalog
- test/regress
- expected
- sql
3 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3519 | 3519 | | |
3520 | 3520 | | |
3521 | 3521 | | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
3522 | 3530 | | |
3523 | 3531 | | |
3524 | 3532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3950 | 3950 | | |
3951 | 3951 | | |
3952 | 3952 | | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
3953 | 3962 | | |
3954 | | - | |
3955 | 3963 | | |
3956 | 3964 | | |
3957 | 3965 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2425 | 2425 | | |
2426 | 2426 | | |
2427 | 2427 | | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
2428 | 2435 | | |
2429 | 2436 | | |
2430 | 2437 | | |
| |||
0 commit comments
Comments
(0)