Using pgbadger with AWS RDS

There’s two non-obvious things to know when starting to use pgbadger with AWS RDS.

First, set:

log_statement = None

Don’t set this to all as the AWS docs suggest.

Further, don’t waste your time trying to add a DB parameter to set log_line_prefix to pgbadger’s recommended value: it’s not possible1. Instead tell pgbadger about the log format that RDS insists on:

pgbadger -f stderr -p '%t:%r:%u@%d:[%p]:' postgres.log

Hope that saves you some time. Note that the -f stderr is required for pgbadger v10 and above2:

——————

Something wrong? Suggest an improvement or add a comment (see article history)
Tagged with: AWS, postgres
Filed in: tips

Previous: A mnemonic for mock decorators
Next: Bash error reporting

Copyright © 2005-2024 David Winterbottom
Content licensed under CC BY-NC-SA 4.0.