Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-03-25 Thread Peter Eisentraut
On 25.03.25 12:52, Alvaro Herrera wrote: Hello On 2025-Mar-25, Peter Eisentraut wrote: A patch in the NOT ENFORCED constraints patch series proposes to refactor some of the code added by this patch series ([0] patch v18-0001). I noticed that the code paths from this patch series do not call I

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-03-25 Thread Alvaro Herrera
Hello On 2025-Mar-25, Peter Eisentraut wrote: > A patch in the NOT ENFORCED constraints patch series proposes to refactor > some of the code added by this patch series ([0] patch v18-0001). I noticed > that the code paths from this patch series do not call > InvokeObjectPostAlterHook() or CacheI

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-03-25 Thread Peter Eisentraut
On 05.03.25 13:56, Alvaro Herrera wrote: On 2025-Mar-03, Suraj Kharage wrote: Thanks Alvaro for the review and fixup patch. I agree with your changes and merged that into the main patch along with a couple of other changes. Please find attached v6 for further review. Thanks, I have pushed t

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-03-05 Thread Alvaro Herrera
On 2025-Mar-03, Suraj Kharage wrote: > Thanks Alvaro for the review and fixup patch. > > I agree with your changes and merged that into the main patch along with a > couple of other changes. > > Please find attached v6 for further review. Thanks, I have pushed this. I made some changes to the

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-03-03 Thread Suraj Kharage
Thanks Alvaro for the review and fixup patch. I agree with your changes and merged that into the main patch along with a couple of other changes. Please find attached v6 for further review. -- Thanks & Regards, Suraj kharage, enterprisedb.com On Sat, Mar 1,

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-02-28 Thread Alvaro Herrera
On 2025-Feb-21, Suraj Kharage wrote: > Thanks, Alvaro. > > I have revised the patch as per your last update. > Please find attached v5 for further review. Hello I noticed two issues. One is that we are OK to modify a constraint that's defined in our parent, which breaks everything. We can onl

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-02-21 Thread Suraj Kharage
Thanks, Alvaro. I have revised the patch as per your last update. Please find attached v5 for further review. -- Thanks & Regards, Suraj kharage, enterprisedb.com On Wed, Feb 19, 2025 at 9:16 PM Alvaro Herrera wrote: > On 2025-Feb-10, Suraj Kharage wrote: >

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-02-19 Thread Alvaro Herrera
On 2025-Feb-10, Suraj Kharage wrote: > Thanks, Alvaro, for the review. > > I have addressed your comments per the above suggestions in the attached v4 > patch. Okay, thanks. It looks good to me, but I realized a few days ago that this patch affects the same code as the patch from Amul Sul to ch

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-02-09 Thread Suraj Kharage
Thanks, Alvaro, for the review. I have addressed your comments per the above suggestions in the attached v4 patch. -- Thanks & Regards, Suraj kharage, enterprisedb.com On Wed, Feb 5, 2025 at 12:11 AM Alvaro Herrera wrote: > On 2025-Jan-13, Suraj Kharage wro

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-02-04 Thread Alvaro Herrera
On 2025-Jan-13, Suraj Kharage wrote: > Please find attached revised version of patch which added the INHERIT to NO > INHERIT state change for not null constraint. Thanks! I find the doc changes a little odd. First, you seem to have added a [INHERIT/NO INHERIT] flag in the wrong place (line 112)

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-01-12 Thread Suraj Kharage
On Wed, Jan 8, 2025 at 2:43 PM Alvaro Herrera wrote: > On 2024-Nov-25, Suraj Kharage wrote: > > > Another case which needs conclusion is - > > When changing from INHERIT to NO INHERIT, we need to walk all children > and > > decrement coninhcount for the corresponding constraint. If a constraint >

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-01-08 Thread Alvaro Herrera
On 2024-Nov-25, Robert Haas wrote: > In a simple implementation of ALTER TABLE this would be true, but I > don't see why it should need to be true in ours. It should be possible > to notice that there's an existing NOT NULL constraint and use that as > evidence that the new one can be added withou

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-01-08 Thread Alvaro Herrera
On 2024-Nov-25, Suraj Kharage wrote: > Another case which needs conclusion is - > When changing from INHERIT to NO INHERIT, we need to walk all children and > decrement coninhcount for the corresponding constraint. If a constraint in > one child reaches zero, should we drop it? not sure. If we do

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2024-11-25 Thread Robert Haas
On Tue, Nov 19, 2024 at 8:22 AM jian he wrote: > current status: > drop table if exists idxpart,idxpart0,idxpart1 cascade; > create table idxpart (a int not null) partition by list (a); > create table idxpart0 (a int constraint foo not null no inherit); > > alter table idxpart attach partition idx

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2024-11-24 Thread Suraj Kharage
Thanks for the review comments. On Wed, Nov 20, 2024 at 9:13 AM jian he wrote: > On Thu, Nov 14, 2024 at 1:02 PM Suraj Kharage > wrote: > > > > Hi, > > > > Upstream commit 14e87ffa5c543b5f30ead7413084c25f7735039f added the > support for named NOT NULL constraints which are INHERIT by default. >

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2024-11-24 Thread Suraj Kharage
-- Thanks & Regards, Suraj kharage, enterprisedb.com On Tue, Nov 19, 2024 at 6:52 PM jian he wrote: > On Fri, Nov 15, 2024 at 11:15 AM Robert Haas > wrote: > > > > On Thu, Nov 14, 2024 at 12:02 AM Suraj Kharage < > suraj.khar...@enterprisedb.com> wrote: > >>

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2024-11-19 Thread jian he
On Thu, Nov 14, 2024 at 1:02 PM Suraj Kharage wrote: > > Hi, > > Upstream commit 14e87ffa5c543b5f30ead7413084c25f7735039f added the support > for named NOT NULL constraints which are INHERIT by default. > We can declare those as NO INHERIT which means those constraints will not be > inherited to

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2024-11-19 Thread jian he
On Fri, Nov 15, 2024 at 11:15 AM Robert Haas wrote: > > On Thu, Nov 14, 2024 at 12:02 AM Suraj Kharage > wrote: >> >> Alvaro stated that allowing a not null constraint state to be modified from >> INHERIT to NO INHERIT is going to be quite problematic because of the number >> of weird cases to

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2024-11-14 Thread Robert Haas
On Thu, Nov 14, 2024 at 12:02 AM Suraj Kharage < suraj.khar...@enterprisedb.com> wrote: > Alvaro stated that allowing a not null constraint state to be modified > from INHERIT to NO INHERIT is going to be quite problematic because of the > number of weird cases to avoid, so for now that support is