Skip to content

Instantly share code, notes, and snippets.

@pfigue
Created October 1, 2014 11:11
Show Gist options
  • Save pfigue/fdc2064f7ca0f1342eef to your computer and use it in GitHub Desktop.
Save pfigue/fdc2064f7ca0f1342eef to your computer and use it in GitHub Desktop.
Monitor PostgreSQL
psql -c "SELECT pg_is_in_recovery();" # true for standby, false for master
psql -c "SELECT txid_current_snapshot();"
psql -c "select pg_last_xlog_receive_location()" # from standby
psql -c "select pg_last_xlog_replay_location()" # from standby
psql -c "SELECT pg_current_xlog_location()" # from master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment