4 lines
126 B
Bash
4 lines
126 B
Bash
|
|
#!/bin/bash
|
||
|
|
ROLE=$(psql -U postgres -tAc "SELECT pg_is_in_recovery();")
|
||
|
|
[ "$ROLE" = "f" ] && echo "primary" || echo "replica"
|