Closed yuzupy closed 6 years ago
Indeed, I totally missed the fact that partition-wise join relies on the fact that different partitioned table can share the same PartitionScheme.
However, I think we need more work here, because we'll have problem if we hypothetically partition two table with the same scheme, and then drop one of them (even if we can't drop only part of the hypothetical partition for now).
We shouldn't store the PartitionScheme when hypopg_partition_table() is called, but instead generate it at plan time, and add our own one to root->part_schemes if it's not present yet. as find_partition_scheme() is doing. This way, it'll also work if we try to join a hypothetically partitioned table with a real partitioned table.
Thank you for your comment.
Yes, indeed. That will be a problem.
And also, the PartitionScheme should be created and stored at plan time as you mentioned. If we do that, can we remove the PartitionScheme from the hypoTable?
yes, it shouldn't be required anymore.
Modified the first part of the hypo_generate_part_scheme() for partition-wise join.