> This can work normally on range partitions. However, the constraint on hash > partitions uses satisfies_hash_partition with the OID of the parent table, and > the newly created constraint does not take effect. For example, in the following > case, although there is a t_p1_a_check constraint on t_p1, it is still possible > to perform an insert:
What I said here is wrong, the constraints on the hash partition will also take
effect. But this constraint depends on the oid of the parent partition.
> Based on the analysis above, should the added constraint for a hash partition > be dropped after detachment?
I have initially implemented this logic in the attached patch and added a
testcase. I really hope that developers can give me some suggestions.