How to completely disable `client_min_messages` in Postgres?

Viewed 75

The C-driver for Postgres prints NOTICE messages to STD output.

How it could be disabled? I'm using STD output for logs and these unexpected messages breaks log parsing.

There's client_min_messages parameter that controls the level of messages, but I need to completely disable it, so even errors shouldn't be printed.

Is there a way to do that? I'm using PostgreSQL 13.2

1 Answers

You could execute

SET client_min_messages = error;

to disable as many messages as possible. Note, however, that

INFO level messages are always sent to the client.

as the documentation says.

But it would be way better to set up a notice handling function as detailed in the documentation.

Related