Skip to content

Instantly share code, notes, and snippets.

@dc2447
Created February 25, 2013 16:07
Show Gist options
  • Save dc2447/5030860 to your computer and use it in GitHub Desktop.
Save dc2447/5030860 to your computer and use it in GitHub Desktop.
Short Bash Script to get the replication delay on Postgres
#!/bin/bash
echo -n "Replication delay on ${HOSTNAME}: "
psql -tA -Upostgres -c 'SELECT NOW() - pg_last_xact_replay_timestamp() AS replication_delay'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment