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

Sergei Kornilov <sk@zsrv.org>

From: Sergei Kornilov <sk@zsrv.org>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Ildar Musin <i.musin@postgrespro.ru>, Stephen Frost <sfrost@snowman.net>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2018-03-06T18:32:08Z
Lists: pgsql-hackers
Hello

> You should be able to use an event trigger that raises a message when
> table_rewrite is hit, to notify the test driver that a rewrite happens.
Here is no table rewrite, only verify. So here EventTriggerTableRewrite is not called. Or i missed something?

> ISTM that depending on DEBUG messages is bad because debugging lines
> added elsewhere will make your tests fail;
I agree and this is reason why i not used DEBUG message in tests as was proposed. I found INFO messages in tests and decided that this was an acceptable option year ago.

> and INFO is generally frowned upon (I, for one, would frown upon an INFO message raised by ALTER
> TABLE, for sure.) so let's not do that either.
In this case we need remove INFO from ALTER TABLE ATTACH PARTITION code and tests. I think is a bad idea of using different rules for same stuff, right? Probably i can do this work too.

But it is necessary to decide how the test should look.

regards, Sergei


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.