Skip to content

Instantly share code, notes, and snippets.

@pzrq
Created November 18, 2014 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pzrq/e54ecfeb99aa1657e071 to your computer and use it in GitHub Desktop.
Save pzrq/e54ecfeb99aa1657e071 to your computer and use it in GitHub Desktop.
PostgreSQL view logged queries OSX
# For OSX Yosemite 10.10 `brew install postgres` [v9.3.5.1]
DATA_DIR='/usr/local/var/postgres/'
vi ${DATA_DIR}postgresql.conf
# Find log_statement in vi, then uncomment and set to 'all'
/log_statement
log_statement = 'all'
# Save / Exit vi
# Remember to set log_statement = 'none' when finished with debugging
pg_ctl -D ${DATA_DIR} reload
tail -f ${DATA_DIR}server.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment