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

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-10-10T14:42:42Z
Lists: pgsql-hackers

Attachments

On Wed, May 21, 2025 at 2:49 PM jian he <jian.universality@gmail.com> wrote:
>
> hi.
>
> 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.

Commits

  1. Make ALTER DOMAIN VALIDATE CONSTRAINT no-op when constraint is already validated