From: Martín Marqués <martin@2ndquadrant.com>
To: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: postgres operational
Date: Wed, 9 Jan 2019 20:43:41 -0300
Message-ID: <31cd6071-8ea5-a29d-ec77-c158a087d2b5@2ndquadrant.com> (raw)
In-Reply-To: <1945c175-0c31-b030-5d52-6535c7f9a5d6@gmail.com>
References: <87181bcc-029b-0c0f-6936-d612f01c2223@netwolves.com>
<ae897346-afb8-f47a-5e2b-0e99fdc48daa@2ndquadrant.com>
<1945c175-0c31-b030-5d52-6535c7f9a5d6@gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: martin@2ndquadrant.com, ronljohnsonjr@gmail.com
Subject: Re: postgres operational
In-Reply-To: <31cd6071-8ea5-a29d-ec77-c158a087d2b5@2ndquadrant.com>
References: <87181bcc-029b-0c0f-6936-d612f01c2223@netwolves.com> <ae897346-afb8-f47a-5e2b-0e99fdc48daa@2ndquadrant.com> <1945c175-0c31-b030-5d52-6535c7f9a5d6@gmail.com> <31cd6071-8ea5-a29d-ec77-c158a087d2b5@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox