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

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Sergei Kornilov <sk@zsrv.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, David Rowley <david.rowley@2ndquadrant.com>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Stephen Frost <sfrost@snowman.net>, Ildar Musin <i.musin@postgrespro.ru>
Date: 2019-03-13T16:20:30Z
Lists: pgsql-hackers
On Wed, Mar 13, 2019 at 11:17 AM Sergei Kornilov <sk@zsrv.org> wrote:
> > The buildfarm thinks additional nitpicking is needed.
>
> hm. Patch was committed with debug1 level tests and many animals uses log_statement = 'all'. Therefore they have additional line in result: LOG:  statement: alter table pg_class alter column relname drop not null; and similar for other queries.
> I think we better would be to revert "set client_min_messages to 'debug1';"  part.

Ugh, I guess so.  Or how about changing the message itself to  use
INFO, like we already do in QueuePartitionConstraintValidation?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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.