Re: postgres operational

From: Martín Marqués <martin(at)2ndquadrant(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: postgres operational
Date: 2019-01-09 23:43:41
Message-ID: 31cd6071-8ea5-a29d-ec77-c158a087d2b5@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El 9/1/19 a las 17:38, Ron escribió:
> On 1/9/19 12:19 PM, Martín Marqués wrote:
>> El 9/1/19 a las 14:58, Steve Clark escribió:
>>> Hi List,
>>>
>>> Is there a sure fire way to tell if postgres server is up an
>>> operational. I was testing to see if the
>>> socket at /tmp/.s.PGSQL.5432 existed - but I ran into a recent
>>> problem on CentOS 7.5, postgresql 9.2.24, where the
>>> socket was there but my script couldn't read from my database yet.
>> Use `check_postgres`
>
> Isn't "pg_ctl status" the canonical method?

Depends on what you are expecting.

`check_postgres` has many different checks, one which will actually try
to connect and run `SELECT 1` to make sure postgres can actually run a
query.

pg_ctl status might return ok, yet you can't connect for other reasons.

--
Martín Marqués http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aidan Samuel 2019-01-10 00:25:09 CREATE OR REPLACE MATERIALIZED VIEW
Previous Message Martín Marqués 2019-01-09 23:40:26 Re: Pulling data from Postgres DB table for every 5 seconds.