Re: using index or check in ALTER TABLE SET NOT NULL

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: sk(at)zsrv(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, alvherre(at)alvh(dot)no-ip(dot)org, Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, i(dot)musin(at)postgrespro(dot)ru, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: using index or check in ALTER TABLE SET NOT NULL
Date: 2018-11-13 12:47:52
Message-ID: CA+q6zcUBXb9DP2n8MX6-35pGxvxft2twMxXUdw-OaWgn9LYyfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sun, 4 Nov 2018 at 19:03, Sergei Kornilov <sk(at)zsrv(dot)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 proper cataloguing 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?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-11-13 12:52:50 Re: Usage of pg_waldump
Previous Message Jürgen Strobel 2018-11-13 12:44:03 Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation