Re: make ALTER DOMAIN VALIDATE CONSTRAINT no-op when constraint is validated

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: jian he <jian(dot)universality(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: make ALTER DOMAIN VALIDATE CONSTRAINT no-op when constraint is validated
Date: 2026-02-24 10:05:11
Message-ID: 2928cd90-909b-486a-bf72-51fbb9620236@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10.10.25 16:42, jian he wrote:
> On Wed, May 21, 2025 at 2:49 PM jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>> Looking at AlterDomainValidateConstraint, it seems currently, ALTER
>> DOMAIN VALIDATE
>> CONSTRAINT will re-validate a VALID constraint, which
>> would just waste cycles.
>> Ideally, this operation should be a no-op.
>>
>> The attached patch addresses this by making ALTER DOMAIN VALIDATE CONSTRAINT a
>> no-op in such cases.
>>
>> ALTER TABLE VALIDATE CONSTRAINT is already a no-op when the constraint is VALID.
>
> hi.
>
> simple rebase.

committed

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2026-02-24 10:05:29 Re: Add errdetail() with PID and UID about source of termination signal
Previous Message Anthonin Bonnefoy 2026-02-24 09:46:51 Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record