dserodio
9/11/2019 - 6:56 PM

Check PostgreSQL connectivity

Useful for testing downtime while applying modifications in RDS

while true; do
  date -Isec | sed -e 's/+00:00//' | tr '\n' ' '
  pg_isready -h YOUR_RDS_INSTANCE.rds.amazonaws.com -U USER -d DB_NAME
  sleep 1
done | tee connection-test-$(date -Imin).log