sql >> Base de Datos >  >> RDS >> PostgreSQL

Consulta para verificar el estado de la base de datos postgresql

https://www.postgresql.org/docs/current /static/app-pg-isready.html

-bash-4.2$ if pg_isready93 -d postgres://localhost:5432/template; then echo "200 OK"; else echo "500 NOT OK"; fi
200 OK
-bash-4.2$ if pg_isready93 -d postgres://localhost:5430/template; then echo "200 OK"; else echo "500 NOT OK"; fi
500 NOT OK

créditos a Abelisto - No se me ocurriría pg_isready en este contexto