Configuring logging for


You’re using on a Mac for local development but are getting SQL errors from your application. You’re seeing an error message:

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

This isn’t very useful: you want to know which query is generating the error.


Turn on Postgres' logging and watch the log files when the error is generated.

This is done by editing ~/Library/Application Support/Postgres/var/postgresql.conf and setting:

logging_collector = on
log_directory = 'pg_log'

then restarting Postgres to pick up the new settings. You can then watch the log files to find out which queries are failing:

tail -f ~/Library/Application\ Support/Postgres/var/pg_log/*


By default, does not have logging enabled which makes local debugging difficult.


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

Previous: Mathematics and engineering
Next: Altering Postgres table columns with South

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