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.96) (envelope-from ) id 1vkObm-00EQIb-2L for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jan 2026 15:34:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkObl-008aa8-1q for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jan 2026 15:34:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vkObk-008aZy-2z for pgsql-bugs@lists.postgresql.org; Mon, 26 Jan 2026 15:34:29 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vkObg-002PgY-1z for pgsql-bugs@lists.postgresql.org; Mon, 26 Jan 2026 15:34:26 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-65063a95558so6340693a12.0 for ; Mon, 26 Jan 2026 07:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769441664; cv=none; d=google.com; s=arc-20240605; b=ilEGS6BCEaqUHzBbCFpPcg/iL/viXolUvvmViqbxRGAzUb08oV8WdNmOtN+8TGW0k5 DoEz/fHhOBfufZIMZVtc0kTTJcHcXIf351fCUMGBZcUBQM7bWDMeMOzbom8IXZbdZOX0 g6UAiZ+ZHNWieS6CQg71EYEZW/0HOKL4Z7eKpJsPlwqMeDyQFu0/ai/KlENGje3KtDaE 8d41rVbAfGB1ua39zFGthXe4uKrF0EhBBhtK1RETJpJJtantGcU1MVYprsBAxg80hMBR tBwGKXRr0dpwLB5Js2wKvVx3jF0WG007BDXGR9gQB5TQGZoREJksevJXZnJafSn1N6vZ 7bbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=Tzm3Tcvb5zw8E6SMUyv+y0ynkK3bDe/2uTmPVl2iA3I=; fh=KmGAEitcCHGvLyRlwuO93eN4Wo5guunBkw9MV7LoFsg=; b=SVpqYrx877wpB36DtUaBBZg8ztvDHxgK1NRfQoskBVgXveCaq7LZrP2ASPZi7PcBsG 5lgOIkWX8MlqzuZI3UBJNvpxjOjxmPpFgloI9n2pksuBMbiRVFZxiQr/D6bjFD+FpyY4 YTUeYNSp4Ng8o9ncowxPbWkiuqSpX/02jN4PXrsn5P/RvS0n4ti9OcGc88CeCtoPPM7J SdFN3pkvOtvhmR2TIzAzclOVVaiuhXgCB0x2hWIsNkGdgCYluJz/8LX2mvPD1F1a2GWL ADDHlkmowDw2ARd44bRx+ck0QUrrGbt6x3ZD3+4JEQBB632/GjDiPwWBckTnUtCAD7rZ CSCA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769441664; x=1770046464; darn=lists.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=Tzm3Tcvb5zw8E6SMUyv+y0ynkK3bDe/2uTmPVl2iA3I=; b=cFmJ//VFcQkVNK36hwTdF0gGgyQ6Iv8Nw13pVMZNgG9DEmEhgtGF2YekaotrX3vaAQ uYYjaN/sL7Ts3iEEXXjjt+6bnQNA7n+6dMMUFUO599Ww8NhVMn1SPBAXV2Jyoo2jyJc1 IhBKeby63KGSx201njIG8jqTkEHSrf1jmlpqG20/n4cGhzbUQDTsCdek0Yv+lsCmRHLF YNYXXk8t995s+bmduy74pBNE6YcZGTiI5lPQvl2UTsRU5pZYz0RkR/R7cOwN75uO3Z5D z1fzOXJ/zpR2ukkEgbzUWa6qajUGH/6LqDwgjknHdYw6ayD4RTggjQdvFgD+ksJ0IHZu Tajw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769441664; x=1770046464; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Tzm3Tcvb5zw8E6SMUyv+y0ynkK3bDe/2uTmPVl2iA3I=; b=kp+VPmd4zFIHDtCY2YRIPmN+0vgW9ZCoPypAgkP4Ly6H+9Vz2ucuoX1bSrtnxNG/Qn 1hlSNBa+SixPe3IWIoiyCCmlYFZ7i7zDkfB9ibb4+xKWsMScepCUoKDiXtaq88SlDauk dEDdsoAkiD+XVL2/DXra/tjebAA0eKV3hhEKNUJbRuLySbgX8kBA5Esz1VZ8etsswbyC OC+lMpA0sdF8/h5NwMcLfQOA4AQYjzAO0ysFkvIiXUhZsOHhXGu9ATd3sewOE1Qgv/j1 43tEZqW5q5FuzBqE3r/a1wzbR6ZxN5dcG24gN7CkOjAx0cZDu1500ww79fJqWwG5UzAt sXIg== X-Forwarded-Encrypted: i=1; AJvYcCXy8jhEOmFDA5P/gT6cixh35fz2WgY3aLAVBP+McpxdLYPwvtA43c03uC88eXHjiwJcr5t5ykMLrQBx@lists.postgresql.org X-Gm-Message-State: AOJu0YzPATEhY3Ycbk74Wy/p5U6e7oFsWmoglt7+Zg8uJd1mvREqVveB Bnbrir8CxvZOw7Xl2ByFWap9UgrLO4gwdEkzD8NgkelnAFOd8xnBTRUtL9ppUZYkh8QQv52m8vr QyFUEEW89k4E43hxZEXoivW7Lf3Murow= X-Gm-Gg: AZuq6aJ3wGYg7cd6Arx1Fw6/MCXuKafRlyw5G0x+5OW7WgRTI0QFncmHX2WmNIX+G7y mUg1XgIOD5Op4gErSLzPVP4OA7CXlo/JxaPXKb6DJdmCWd3KnCQR+boVsUxXi60ygAoSEbYUYqD H65Lg4UIx7trw7YTG3XzB0iSRZiYPGKQXQO0sTmJzEE9c+evnuLFdJlVUm7E/4WXtwCqCfNfu9c 2tvv1ShMl++GayQ7Jxw8XwEbZDiyWxPDTTyHerFXW7a3ox2gHM2RBA6eERZIvIHePIYM0h+TsMo fIP9jaPK3j1ibKTb+5h1k3rrP1nAItKbrFJuusFhLhwqAIhX2+iX9g2kE13E1Th3NK0Vi8YFeoc 4GsmpTRBgYHRiY42XfD2wI/iZ X-Received: by 2002:a17:907:9686:b0:b87:1839:2600 with SMTP id a640c23a62f3a-b8d20e2938fmr345804566b.33.1769441663577; Mon, 26 Jan 2026 07:34:23 -0800 (PST) MIME-Version: 1.0 References: <202601261426.hr65rf3efvr3@alvherre.pgsql> In-Reply-To: <202601261426.hr65rf3efvr3@alvherre.pgsql> From: Srinath Reddy Sadipiralla Date: Mon, 26 Jan 2026 21:04:12 +0530 X-Gm-Features: AZwV_QhQXXkOHT_kfeEQWM0gKDlr6vmFrwzrmF-FXumPUZhDc8lpYLgTvKpAlo8 Message-ID: Subject: Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem. To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: yanliang lei , pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000cef2d306494c3d46" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000cef2d306494c3d46 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 26, 2026 at 8:03=E2=80=AFPM =C3=81lvaro Herrera wrote: > > > I think we can fix this by throwing an error only if this constraint > > was added directly to the table and not through > > inheritance/propagation from the parent, we can do this using the > > "is_local" flag, i have checked and all tests passed. > > Hmm, I'm not opposed to this; does it change any other behavior? I > think it's important to see whether there are other corner cases that > would react to this behavior change. For example, what would happen if > two existing parents have a not-null constraint on the same column? Is > there a change for combined LIKE and regular inheritance? I think we > should have reasonable reactions to each of those scenarios: > > create table parent (a int not null); > create table parent2 (a int not null); > > create table child1 () inherits (parent, parent2); > create table child2 () inherits (parent2, parent); > create table child3 (not null a) inherits (parent2, parent); > > create table child4 (like parent) inherits (parent2); > -- and so on as your imagination allows > Thanks for the pointers, will look into this angle also. Would you be able to send a patch based on this idea and what I sent > earlier? > sure , I will do that. --=20 Thanks, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/ --000000000000cef2d306494c3d46 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Jan 26,= 2026 at 8:03=E2=80=AFPM =C3=81lvaro Herrera <alvherre@kurilemu.de> wrote:

> I think we can fix this by throwing an error only if this constraint > was added directly to the table and not through
> inheritance/propagation from the parent, we can do this using the
> "is_local" flag, i have checked and all tests passed.

Hmm, I'm not opposed to this; does it change any other behavior?=C2=A0 = I
think it's important to see whether there are other corner cases that would react to this behavior change.=C2=A0 For example, what would happen i= f
two existing parents have a not-null constraint on the same column?=C2=A0 I= s
there a change for combined LIKE and regular inheritance?=C2=A0 I think we<= br> should have reasonable reactions to each of those scenarios:

create table parent (a int not null);
create table parent2 (a int not null);

create table child1 () inherits (parent, parent2);
create table child2 () inherits (parent2, parent);
create table child3 (not null a) inherits (parent2, parent);

create table child4 (like parent) inherits (parent2);
-- and so on as your imagination allows

=C2=A0Than= ks for the pointers, will look into this angle also.

Would you be able to send a patch based on this idea and what I sent
earlier?=C2=A0

sure , I will do that.=C2=A0
<= /div>


--
Thanks,
Srinath Reddy Sadi= piralla
EDB:=C2=A0https://www.enterprisedb.com/
--000000000000cef2d306494c3d46--