HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlModerate

How to disable the logging of parameter values in PostgreSQL

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlloggingthedisablehowvaluesparameter

Problem

Is there a way to disable the logging of the parameter values used in a query, while still logging the actual query itself?

I'd like to set log_min_duration_statement = 0 to use with pgBadger. I'm getting two lines per query like:

LOG: Select * from table where id = $1

DETAIL: parameters: $1 = 55


I'd really like to suppress the DETAIL lines because it's bloating my logs and saving sensitive information.

Is it possible to disable this from within Postgres?

Solution

You can set log_error_verbosity = TERSE

The manual:


Controls the amount of detail written in the server log for each
message that is logged. Valid values are TERSE, DEFAULT, and VERBOSE,
each adding more fields to displayed messages. TERSE excludes the
logging of DETAIL, HINT, QUERY, and CONTEXT error information.

Bold emphasis mine.

Context

StackExchange Database Administrators Q#129924, answer score: 11

Revisions (0)

No revisions yet.