Book Image

PostgreSQL Administration Essentials

Book Image

PostgreSQL Administration Essentials

Overview of this book

Table of Contents (14 chapters)

Configuring the amount of log output


In this section, we will discuss how to control the amount of log produced by the database. The default configuration of PostgreSQL provides us only with error messages. Sometimes, this is just not enough. The goal of this section is to provide you with all the information you need to make PostgreSQL more verbose.

The central configuration variable here is log_statements:

log_statement = 'all'             # none, ddl, mod, all

Let's see the description of the variables used in the preceding code snippet:

  • none: In this case, only error messages are logged (syntax errors, panics, fatal errors, and so on).

  • ddl: At this level, we will already log all errors, including all commands that change the data structure (CREATE TABLE, ALTER TABLE, and so on).

  • mod: In this case, in addition to errors and structural changes, we can also log statements, which change data (for example, INSERT, UPDATE, DELETE, and so on).

  • all: In this case, we can finally log all statements...