Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Date: 2025-02-07 11:14:15
Message-ID: 202502071114.kosxwvgyblj7@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Recursion to child tables is incorrectly trying to locate the constraint
by name:

create table notnull_tbl1 (a int);
alter table notnull_tbl1 add constraint foo not null a not valid;
create table notnull_chld (a int);
alter table notnull_chld add constraint blah not null a not valid;
alter table notnull_chld inherit notnull_tbl1 ;

-- this fails but shouldn't:
alter table notnull_tbl1 validate constraint foo;
ERROR: constraint "foo" of relation "notnull_chld" does not exist

The end result here should be that the constraint `blah` in table
notnull_chld is marked as validated.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Syntax error: function hell() needs an argument.
Please choose what hell you want to involve.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yura Sokolov 2025-02-07 11:24:49 Re: Get rid of WALBufMappingLock
Previous Message Yura Sokolov 2025-02-07 11:02:48 Re: Get rid of WALBufMappingLock