Re: using index or check in ALTER TABLE SET NOT NULL - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: using index or check in ALTER TABLE SET NOT NULL
Date
Msg-id 20181113125949.pmgdlgs43bzozwsv@alvherre.pgsql
Whole thread Raw
In response to Re: using index or check in ALTER TABLE SET NOT NULL  (Dmitry Dolgov <9erthalion6@gmail.com>)
Responses Re: using index or check in ALTER TABLE SET NOT NULL  (Dmitry Dolgov <9erthalion6@gmail.com>)
List pgsql-hackers
On 2018-Nov-13, Dmitry Dolgov wrote:

> > On Sun, 4 Nov 2018 at 19:03, Sergei Kornilov <sk@zsrv.org> wrote:
> >
> > > If not properly cataloguing NOT NULL constraints would be fixed, can it
> > > potentially conflict with the current patch or not?
> > We already doing same stuff for "alter table attach partition" and in this patch i use exactly this routine. If
propercataloguing would conflict with my patch - it would conflict with "attach partition" validation too.
 
> > I think proper cataloguing can be implemented without conflict with proposed feature.
> 
> Yes, indeed, this patch relies on the PartConstraintImpliedByRelConstraint.
> Then maybe it makes sense to go with the solution, proposed in this thread,
> while leaving open the possibility of having "SET NOT NULL NOT VALID"? From
> the functionality point of view it definitely would be beneficial. Any other
> opinions?

I think we should ignore any SET NOT NULL NOT VALID patches, because
in practice they don't exist.  Let's move forward with this, because the
optimization being proposed is clearly very useful.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: move PartitionBoundInfo creation code
Next
From: Amit Kapila
Date:
Subject: Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query