public inbox for [email protected]  
help / color / mirror / Atom feed
From: Srinath Reddy Sadipiralla <[email protected]>
To: Álvaro Herrera <[email protected]>
Cc: yanliang lei <[email protected]>
Cc: [email protected]
Subject: Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.
Date: Mon, 26 Jan 2026 21:04:12 +0530
Message-ID: <CAFC+b6qFKkU_NpH1snNc9_iZzpkxgWpUAibEz1tRYGFRSasqCQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAFC+b6qKTes6Uz5gfjq=N0=AcOi5RD=JnRqbU-WnhN2dC21YDw@mail.gmail.com>
	<[email protected]>

On Mon, Jan 26, 2026 at 8:03 PM Álvaro Herrera <[email protected]> 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.


-- 
Thanks,
Srinath Reddy Sadipiralla
EDB: https://www.enterprisedb.com/


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.
  In-Reply-To: <CAFC+b6qFKkU_NpH1snNc9_iZzpkxgWpUAibEz1tRYGFRSasqCQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox