Last active
October 10, 2017 07:41
-
-
Save toddlers/bb768ac21a5c0148d74622e00d2ef97d to your computer and use it in GitHub Desktop.
postgres_commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check master/slave status | |
# if f its master otherwise its slave | |
select pg_is_in_recovery(); | |
#check lag status | |
SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::INT; | |
# check slave status | |
SELECT pg_last_xlog_receive_location(); | |
# check activity status | |
select * from pg_stat_activity ; | |
# allow selected cidr in pg_hba | |
postgres=# show hba_file; | |
hba_file | |
--------------------------------------- | |
/etc/postgresql/9.5/slave/pg_hba.conf | |
postgres=# SELECT pg_reload_conf(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment