Change ereport level for QueuePartitionConstraintValidation

Sergei Kornilov <sk@zsrv.org>

From: Sergei Kornilov <sk@zsrv.org>
To: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2019-03-15T09:55:36Z
Lists: pgsql-hackers

Attachments

Hello

Per discussion started here: https://www.postgresql.org/message-id/CA%2BTgmoZWSLUjVcc9KBSVvbn%3DU5QRgW1O-MgUX0y5CnLZOA2qyQ%40mail.gmail.com

We have INFO ereport messages in alter table attach partition like this:
> partition constraint for table \"%s\" is implied by existing constraints

Personally I like this message and not want remove it.
But recently my colleague noticed that INFO level is written to stderr by psql. For example, simple command

> psql -c "alter table measurement attach partition measurement_y2006m04 for values from ('2006-04-01') to ('2006-05-01');"

can produce stderr output like error, but this is expected behavior from successful execution.

And INFO level always sent to client regardless of client_min_messages as clearly documented in src/include/utils/elog.h

So now I am +1 to idea of change error level for this messages. I attach patch to lower such ereport to DEBUG1 level

thanks

PS: possible we can change level to NOTICE but I doubt we will choose this way

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.