pgsql: Prevent creation of duplicate not-null constraints for domains

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Prevent creation of duplicate not-null constraints for domains
Date: 2025-07-03 09:47:00
Message-ID: E1uXGWy-004Uq6-00@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Prevent creation of duplicate not-null constraints for domains

This was previously harmless, but now that we create pg_constraint rows
for those, duplicates are not welcome anymore.

Backpatch to 18.

Co-authored-by: jian he <jian(dot)universality(at)gmail(dot)com>
Co-authored-by: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Discussion: https://postgr.es/m/CACJufxFSC0mcQ82bSk58sO-WJY4P-o4N6RD2M0D=DD_u_6EzdQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/647cffd2f3210818f3882a1ea40cfbe0a4ea8fd7

Modified Files
--------------
src/backend/commands/typecmds.c | 14 +++++++++++---
src/test/regress/expected/domain.out | 5 +++++
src/test/regress/sql/domain.sql | 3 +++
3 files changed, 19 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-07-03 12:03:56 Re: pgsql: Fix bogus grammar for a CREATE CONSTRAINT TRIGGER error
Previous Message Álvaro Herrera 2025-07-03 09:30:23 pgsql: Fix bogus grammar for a CREATE CONSTRAINT TRIGGER error