Type: | enum |
Default: | none |
Context: | superuser |
Restart: | false |
Values: | [none, ddl, mod, all] |
Controls which SQL statements are logged. Valid values are none
(off), ddl
, mod
, and all
(all statements). ddl
logs all data definition statements, such as CREATE, ALTER, and DROP statements. mod
logs all ddl
statements, plus data-modifying statements such as INSERT, UPDATE, DELETE, TRUNCATE, and COPY FROM. PREPARE, EXECUTE, and EXPLAIN ANALYZE statements are also logged if their contained command is of an appropriate type. For clients using extended query protocol, logging occurs when an Execute message is received, and values of the Bind parameters are included (with any embedded single-quote marks doubled).
The default is none
. Only superusers and users with the appropriate SET
privilege can change this setting.
Statements that contain simple syntax errors are not logged even by the log_statement
= all
setting, because the log message is emitted only after basic parsing has been done to determine the statement type. In the case of extended query protocol, this setting likewise does not log statements that fail before the Execute phase (i.e., during parse analysis or planning). Set log_min_error_statement to ERROR
(or lower) to log such statements.
Logged statements might reveal sensitive data and even contain plaintext passwords.
Recommendations
On StackOverflow
On pgsql-hackers
- Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed
- BUG: Former primary node might stuck when started as a standby
- Re: filesystem full during vacuum - space recovery issues
- Add TAP tests for backtrace functionality (was Re: Add test module for verifying backtrace functionality)
- Add a warning message when using unencrypted passwords