Re:BUG #18371: There are wrong constraint residues when detach hash partiton concurrently
feichanghong <feichanghong@qq.com>
From: feichanghong <feichanghong@qq.com>
To: feichanghong <feichanghong@qq.com>, pgsql-bugs <pgsql-bugs@lists.postgresql.org>, alvherre <alvherre@alvh.no-ip.org>
Date: 2024-02-29T06:21:58Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Stop creating constraints during DETACH CONCURRENTLY
- ea06f97eeb33 17.7 landed
- bdae98495660 15.15 landed
- b835759ec7e8 16.11 landed
- b753be38a4a2 14.20 landed
- 3231fd045522 19 (unreleased) landed
- 08c037dff961 18.1 landed
-
Rename SLRU elements in view pg_stat_slru
- bcdfa5f2e2f2 17.0 cited
Attachments
- v1-0000-drop-constraint-for-hash-partition.patch (application/octet-stream) patch v1-0000
> 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. Best Regards, Fei Changhong Alibaba Cloud Computing Ltd.