79153617

Date: 2024-11-03 20:50:57
Score: 1
Natty:
Report link

Bash command to detect PostgreSQL synchronous standby by Patroni API and jq

/usr/pgsql-16/bin/pg_isready -q && \
  test "$(hostname -I | xargs):5432" == "$(curl -s localhost:8008/cluster | jq -Mcr '.members[] | select (.role == "sync_standby") | .host + ":" + (.port|tostring)')"
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Rinat