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

Dmitry Dolgov <9erthalion6@gmail.com>

From: Dmitry Dolgov <9erthalion6@gmail.com>
To: sk@zsrv.org
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, alvherre@alvh.no-ip.org, Stephen Frost <sfrost@snowman.net>, Robert Haas <robertmhaas@gmail.com>, i.musin@postgrespro.ru, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2018-11-04T14:18:20Z
Lists: pgsql-hackers
>On Sun, 15 Apr 2018 at 09:09, Sergei Kornilov <sk@zsrv.org> wrote:
>
> Attached updated patch follows recent Reorganize partitioning code commit.
> regards, Sergei

This patch went through the last tree commit fests without any noticeable
activity, but cfbot says it still applies and doesn't break any tests. The
patch itself is rather small, the only significant objection I see from the
thread is that probably "SET NOT NULL NOT VALID" feature could be more
appropriate way of fixing the original problem, but looks like no one is
working on that (the only related thread I could found was this one [1]). If
not properly cataloguing NOT NULL constraints would be fixed, can it
potentially conflict with the current patch or not?


[1]: https://www.postgresql.org/message-id/flat/CAASwCXcOokBqHf8BXECbDgOLkXxJyL_Q_twhg2dGWSvgMzz%3DxA%40mail.gmail.com


Commits

  1. Avoid using INFO elevel for what are fundamentally debug messages.

  2. Revert setting client_min_messages to 'debug1' in new tests.

  3. Allow ALTER TABLE .. SET NOT NULL to skip provably unnecessary scans.

  4. Improve predtest.c's internal docs, and enhance its functionality a bit.