Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.