Re: [PATCH v1] Fix for Bug#19724 - ALTER TYPE ... ALTER ATTRIBUTE triggers internal error for base type of domain with check

From: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
To: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Cc: Nitin Motiani <nitinmotiani(at)google(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH v1] Fix for Bug#19724 - ALTER TYPE ... ALTER ATTRIBUTE triggers internal error for base type of domain with check
Date: 2026-09-28 21:06:59
Message-ID: ac6da38a-be44-43fc-b67b-e5cffa1a2afb@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 28/09/26 17:40, Ayush Tiwari wrote:
>> Attached are:
>>
>> - v2-0001: Nitin's v1, unchanged.
>>
>> - v2-0002: validate re-added domain constraints after the rewrites
>> (issue 1).
>
> Thanks, the split looks right to me.
>
> On 0002, remembering the new constraint OID and calling
> validateDomainCheckConstraint() directly is better than what I suggested.
> Using the OID avoids resolving the domain and constraint by name again in
> phase 3, and the standalone-composite case needs the new loop not to skip
> relations without storage. One small thing: the new loop doesn't
> CommandCounterIncrement() between constraints. Probably fine today, but
> the FK loop and afterStmts do. And I think 0001 and 0002 can be clubbed
> together (though that can be done whilst committing)
>

Thank you for checking the patches.

I don't think that the FK loop call CommandCounterIncrement() or I'm
missing something? Also I think that afterStmts call it because it use
ProcessUtilityForAlterTable, so I don't think that it is required for
the new domain constraints loop, but I might be wrong.

I'm not sure if these two patches should be squashed into a single
one. I see these both issues as separated issues, although the fix on
0001 enable the second issue to happen more easily.

> I've only looked closely at 0001 and 0002 so far, which fix the reported
> case for me across branches. I'll come back on 0003.
>

Thank you!

--
Matheus Alcantara
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2026-09-28 21:33:58 Re: parallel autovacuum: Propagate track_cost_delay_timing to parallel workers
Previous Message Andrew Krylosov 2026-09-28 20:56:29 Re: pg_dump: ALTER INDEX SET STATISTICS missing for index-backed constraints