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

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: make ALTER DOMAIN VALIDATE CONSTRAINT no-op when constraint is validated
Date: 2025-05-21 06:49:33
Message-ID: CACJufxG=-Dv9fPJHqkA9c-wGZ2dDOWOXSp-X-0K_G7r-DgaASw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
v1-0001-make-ALTER-DOMAIN-VALIDATE-CONSTRAINT-no-op-when-constrai.patch text/x-patch 2.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2025-05-21 07:12:54 Re: proposal: schema variables
Previous Message Andy Fan 2025-05-21 06:49:28 parallel_safe