| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | jian he <jian(dot)universality(at)gmail(dot)com> |
| Cc: | Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Fix bug of CHECK constraint enforceability recursion |
| Date: | 2026-06-17 07:22:44 |
| Message-ID: | FD1A15D5-0FAD-4CD3-9D5C-C76F0D813563@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On Jun 17, 2026, at 11:27, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
> On Tue, Jun 9, 2026 at 8:32 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>
>> In v10, I split the “because” part to a errdetail, also moved out NOT ENFORCED out of the translate message.
>>
>
> ATCheckCheckConstrHasEnforcedParent
> ``````
> if (constraints_equivalent(parenttup, contuple,
> RelationGetDescr(conrel)))
> {
> ``````
> The above IF condition is basically always true (see
> MergeConstraintsIntoExisting), unless an inherited check constraint
> has a
> different definition, which should not happen.
> So I did a quick refactor here, which also drops the nesting level down by one.
>
> Other than that, v10 looks good to me.
>
>
>
> --
> jian
> https://www.enterprisedb.com/
> <v10-0001-misc-refactor-ATCheckCheckConstrHasEnforcedParent.nocfbot>
Thanks for your suggestion, I think that is correct.
PFA v11 - 0001 integrated Jian’s change; 0002 and 0003 unchanged.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| Attachment | Content-Type | Size |
|---|---|---|
| v11-0001-Prevent-inherited-CHECK-constraints-from-being-w.patch | application/octet-stream | 25.3 KB |
| v11-0002-doc-Clarify-inherited-constraint-behavior.patch | application/octet-stream | 4.4 KB |
| v11-0003-doc-Clarify-ALTER-CONSTRAINT-enforceability-beha.patch | application/octet-stream | 2.3 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Amit Kapila | 2026-06-17 07:23:20 | Re: DOCS - Clarify behaviour when EXCEPT tables are moved/renamed |
| Previous Message | Pavel Stehule | 2026-06-17 07:20:52 | Re: proposal - queryid can be used as filter for auto_explain |