79153639

Date: 2024-11-03 21:08:01
Score: 0.5
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 (0.5):
Posted by: Rinat