Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1thCWG-00HYq0-QQ for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Feb 2025 18:59:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1thCWE-00Fs6R-In for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Feb 2025 18:59:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1thCWE-00Fs6I-9W for pgsql-hackers@lists.postgresql.org; Sun, 09 Feb 2025 18:59:02 +0000 Received: from mail-vk1-xa34.google.com ([2607:f8b0:4864:20::a34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1thCWB-004nvm-13 for pgsql-hackers@postgresql.org; Sun, 09 Feb 2025 18:59:01 +0000 Received: by mail-vk1-xa34.google.com with SMTP id 71dfb90a1353d-520496c9a6bso39558e0c.1 for ; Sun, 09 Feb 2025 10:58:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739127538; x=1739732338; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zHkUvwEXrckY8C1JDvRk7oeOAYDjpvNtMOu9wlttl5Q=; b=kENTDwu7blu9rshovvO1jnb4h/M9/JPcv7EQP7pIxRiradmnmBfAMnRSHOLXIBX30X mOlUagdthOJ7CtNjNnNrF8onDpGd+jeZ9PvNQnlqK5I/5yhnK+o/74/QTHv+lt6MSQkV HCAASNR2ZeHXEEmvOEm5K9SA7Zwk5Mz3O03EGfDLOqQ41cpjIQzkp2pG3AAxwgu/Mqfc NcUyfCSKs2EUrUF2jnDkp6lUyacrGZTNBjJVwKcXHo6MLga5ONGxX/nileT28mGBRim5 HX+JphhxiXiAgwwBG/CQpEDCj8IFglqEUBihZTAnr62uD+deJMwAp8XrD9inFZQ1jFhY 1WTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739127538; x=1739732338; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zHkUvwEXrckY8C1JDvRk7oeOAYDjpvNtMOu9wlttl5Q=; b=OrqTvtFTkDnqL7/Oq/ScUO88VN0uu4AixO6qEaq4QhscCmPoD4SRPzIktpi3RIbERg zEEgk4ipoB0gITb3ILR3CJvmZHWJWmiY/TdZ+f3AaDcSaRdJYWUUS4YWWtMZKvizDbQv zJjCxIkbDV/2ETZ82PLIBJ04JLmcFN/QuUyoAwE2Le2bXekglDn5siYE2uOM1WSuxYIY mxdIb9okaIXDER6BeUEGhW3U2idkl6YbIJ3qzD7SNMiXtCg9Zi5pqMw5ITWxRo+hkChs IB/p5ZIwB+QJH02m7BjmdCpOz6/NLNOhnm7QkOlyBT8QregtuY1MCQHbSC/WV4dNSYR8 6oNw== X-Gm-Message-State: AOJu0YwVcXgCf2MCWSYgemJbKjTQCexmtDTMxJ9ACwoXcrL8ofQss6OZ 3SNAbRxo9ALVibh2e4+f3HYwg0lFBbArCHwPCIc8AbTkvP8ex28aolwDOo9ZEIvgYoz7haMNQco ryAwZIQ3pI18gQsPNouzzEkQuZQ== X-Gm-Gg: ASbGnctIxKMy5iC0skPxrlRLvaOi6pLkW65ZChVRC/XSyUErbvVuvyw39X0RGFyr20Q YjQFZYRqo6CqMDKPReO60amgSFebkpG7RLdDFblXB+CCmVnFE8zy/JCo98fZvJh0QUFnq6mrJxQ == X-Google-Smtp-Source: AGHT+IFKFGxFN766/k/L+gVjv+fsoYQ8oBdjQlF3T0n3HvmW6gMK9SaSVDB6Jd6quPwbzSFqq3xzPYmwS08IXjbYYBk= X-Received: by 2002:a05:6122:1d49:b0:520:42d3:91bc with SMTP id 71dfb90a1353d-52042d3968emr1006161e0c.2.1739127537653; Sun, 09 Feb 2025 10:58:57 -0800 (PST) MIME-Version: 1.0 References: <202502071114.kosxwvgyblj7@alvherre.pgsql> In-Reply-To: <202502071114.kosxwvgyblj7@alvherre.pgsql> From: Rushabh Lathia Date: Mon, 10 Feb 2025 00:28:45 +0530 X-Gm-Features: AWEUYZnBgZweiqMP-Ik-_35y1mOOYfm-PlzU15eQoN60VdRaLh00X7T-JQXj2dE Message-ID: Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints To: Alvaro Herrera Cc: PostgreSQL Hackers Content-Type: multipart/alternative; boundary="00000000000019e163062dba2f75" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000019e163062dba2f75 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 7, 2025 at 4:44=E2=80=AFPM Alvaro Herrera wrote: > > 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. > Yes, I agree. Here we need a separate Queue for NotNull constraint validation, which fetches the respective Non-Validate-Not-Null constraint name from the child table I am working on the patch and will post the update patch soon. > > -- > =C3=81lvaro Herrera 48=C2=B001'N 7=C2=B057'E =E2=80=94 > https://www.EnterpriseDB.com/ > Syntax error: function hell() needs an argument. > Please choose what hell you want to involve. > --=20 Rushabh Lathia --00000000000019e163062dba2f75 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Feb 7, = 2025 at 4:44=E2=80=AFPM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

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:=C2=A0 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.

Ye= s, I agree.=C2=A0 Here we need a separate Queue for NotNull constraint vali= dation,
which fetches the respective Non-Validate-Not-Null constr= aint name from
the child table

I am work= ing on the patch and will post the update patch soon.
=C2=A0

--
=C3=81lvaro Herrera=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A04= 8=C2=B001'N 7=C2=B057'E=C2=A0 =E2=80=94=C2=A0 https://www.Enter= priseDB.com/
Syntax error: function hell() needs an argument.
Please choose what hell you want to involve.


--
Rushabh Lathia
--00000000000019e163062dba2f75--