Skip to content

Instantly share code, notes, and snippets.

@jrasanen
Last active August 29, 2017 06:25
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 jrasanen/b9bc0125f3da33bde1e657521cf40df2 to your computer and use it in GitHub Desktop.
Save jrasanen/b9bc0125f3da33bde1e657521cf40df2 to your computer and use it in GitHub Desktop.
-bash-4.1$ cat /usr/local/bin/pause_replication.sh
/opt/PostgreSQL/9.2/bin/psql -U postgres -c 'select pg_xlog_replay_pause();'
/opt/PostgreSQL/9.2/bin/psql -U postgres -c 'select now() - pg_last_xact_replay_timestamp() AS replication_delay;'
-bash-4.1$ cat /usr/local/bin/resume_replication.sh
/opt/PostgreSQL/9.2/bin/psql -U postgres -c 'select pg_xlog_replay_resume();'
/opt/PostgreSQL/9.2/bin/psql -U postgres -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