Re: Disallow concurrent ALTER DOMAIN and DROP DOMAIN

From: Andres Freund <andres(at)anarazel(dot)de>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Disallow concurrent ALTER DOMAIN and DROP DOMAIN
Date: 2026-01-05 21:53:50
Message-ID: gbtzaiz22bhqtvab3dslyffkevilxzyqn64n46cqggaikor6pf@qq4timkwwyqc
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-05-23 21:19:07 +0800, jian he wrote:
> similar to thread "Prevent internal error at concurrent CREATE OR
> REPLACE FUNCTION"
> [1].
>
> We should prevent concurrent modifications to a domain's definition. Currently,
> it is possible for one session to drop a domain while another session
> simultaneously adds a constraint to it.
> It may result in errors such as "tuple concurrently updated."
>
> also dropping a domain should not be allowed if another session is
> modifying it, IMHO.
>
> The attached patch is very similar to the "CREATE OR REPLACE FUNCTION"
> thread [1],
> by acquiring a AccessExclusiveLock on the changed domain oid.
> Other sessions must wait for the current transactions to finish
> modifying the domain definition
> before making changes on it.

I don't know if this is still an active patch - if it is, it'd be good to fix
CI:
https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F5773
it doesn't build.

If it's not current anymore, please close the CI entry.

Greetings,

Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-01-05 21:55:00 Re: Typos in the code and README
Previous Message Andres Freund 2026-01-05 21:50:59 Re: Typos in the code and README