feat: ajout des scripts pour le basculement automatique
This commit is contained in:
parent
0f66a76617
commit
ee0d6fe9bb
2 changed files with 14 additions and 0 deletions
3
verifier_role_db.sh
Normal file
3
verifier_role_db.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
ROLE=$(psql -U postgres -tAc "SELECT pg_is_in_recovery();")
|
||||
[ "$ROLE" = "f" ] && echo "primary" || echo "replica"
|
||||
Loading…
Add table
Add a link
Reference in a new issue