pg_isready

Check PostgreSQL availability

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Tests whether a server accepts connections.

Examples
pg_isready -h db -p 5432Check · explain & risk-check →
Related
psql
Open the full explainer →More in Databases

Reference text is hand-written and may be incomplete — check man pg_isready for your version. Test destructive commands on a non-production system first.