Reducing log messages on the client

06.2014 / Category: / Tags:

It happens quite frequently that PostgreSQL client applications are flooded with messages from the server. This is both annoying and bad for performance as well as network bandwidth. It seems that many users are not aware of the fact that this flood of log messages can easily be reduced by simply changing the server configuration.

Here is an example showing how log messages can reach the client:

In this example we issue a simple NOTICE. This message will end up in the log as well as on the client:

Just imagine calling this function millions of times (which is perfectly realistic) - all those messages have to go somewhere.

Closing the flood gates …

Reducing the amount of log to a normal level is actually quite simple:

In our example client_min_messages makes sure that an error message has to be at least an ERROR to make it to the client application.

Of course, you can also configure that per user or per database:

PostgreSQL allows a pretty fine-grained configuration here, which can be tweaked to meet your requirements.

Find out more related PostgreSQL hints and tips in our blog posts about setup and configuration.

0 0 votes
Article Rating
Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
9 years ago

Didn't know this feature 🙂

CYBERTEC Logo white
CYBERTEC PostgreSQL International GmbH
Römerstraße 19
2752 Wöllersdorf

+43 (0) 2622 93022-0

Get the newest PostgreSQL Info & Tools

    This site is protected by reCAPTCHA and the Google Privacy Policy & Terms of Service apply.

    CYBERTEC PostgreSQL International GmbH
    Would love your thoughts, please comment.x
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram