| From: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
|---|---|
| To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
| Cc: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com> |
| Subject: | Re: Fix ALTER DOMAIN VALIDATE CONSTRAINT locking |
| Date: | 2026-06-12 13:02:37 |
| Message-ID: | aiwCM8TnJOPDUoOC@alvherre.pgsql |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hello,
On 2026-Jun-12, Fujii Masao wrote:
> I just have a few minor review comments.
>
> * The lockmode is used for relations using the domain. It should be
> * ShareLock when adding a new constraint to domain. It can be
> * ShareUpdateExclusiveLock when validating an existing constraint.
>
> This comment in validateDomainCheckConstraint() still references
> ShareUpdateExclusiveLock, so it seems to need updating.
I may be missing something, but doesn't changing the
ShareUpdateExclusive lock to ShareLock means essentially reverting
16a0039dc0d1? I mean, the code was previously using ShareLock for both
uses of validateDomainCheckConstraint(); and what that commit did was
change AlterDomainValidateConstraint() to use ShareUpdateExclusiveLock,
while AlterDomainAddConstraint() retained the stronger ShareLock level.
If we now change AlterDomainValidateConstraint() back to ShareLock, then
the aforementioned commit has no effect whatsoever.
> After the fix is committed, we should probably also ask Bruce to update
> the following v19 release note item?:
>
> Reduce lock level of ALTER DOMAIN ... VALIDATE CONSTRAINT to match
> ALTER TABLE ... VALIDATE CONSTRAINT (Jian He) §
If we make this change, then the release note item should be removed
entirely, ISTM.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Shlok Kyal | 2026-06-12 13:03:32 | Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication |
| Previous Message | Álvaro Herrera | 2026-06-12 12:53:55 | Re: PSQL - prevent describe listing tables that are already in listed schemas |