agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Matheus Alcantara <matheusssilv97@gmail.com>
To: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: Nitin Motiani <nitinmotiani@google.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PATCH v1] Fix for Bug#19724 - ALTER TYPE ... ALTER ATTRIBUTE triggers internal error for base type of domain with check
Date: Mon, 28 Sep 2026 18:06:59 -0300
Message-ID: <ac6da38a-be44-43fc-b67b-e5cffa1a2afb@gmail.com> (raw)
In-Reply-To: <CAJTYsWWprdm_eLMT1xgtp8GCK3SdUv3cFa+rx=S2c2Jnc7RPRA@mail.gmail.com>
References: <CAH5HC94+4teDZvuWkBiAikcK1pM2DH9W6iCNDoGpHxUdPGTNPw@mail.gmail.com>
	<CAJTYsWUwEebLYkSD_+2L6tOp8nL9-TyaLkOYcb1q6viAH=ejNw@mail.gmail.com>
	<DLR67P6TO2C8.3SL4J7XR66QBJ@gmail.com>
	<CAJTYsWWprdm_eLMT1xgtp8GCK3SdUv3cFa+rx=S2c2Jnc7RPRA@mail.gmail.com>

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






view thread (11+ messages)  latest in thread

Message-ID: <ac6da38a-be44-43fc-b67b-e5cffa1a2afb@gmail.com>
Permalink:  ../ac6da38a-be44-43fc-b67b-e5cffa1a2afb@gmail.com/
Also on:    postgresql.org/message-id/ac6da38a-be44-43fc-b67b-e5cffa1a2afb@gmail.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: matheusssilv97@gmail.com, ayushtiwari.slg01@gmail.com, nitinmotiani@google.com
  Subject: Re: [PATCH v1] Fix for Bug#19724 - ALTER TYPE ... ALTER ATTRIBUTE triggers internal error for base type of domain with check
  In-Reply-To: <ac6da38a-be44-43fc-b67b-e5cffa1a2afb@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox