RE: postgres operational

From: Scot Kreienkamp <Scot(dot)Kreienkamp(at)la-z-boy(dot)com>
To: Steve Clark <steve(dot)clark(at)netwolves(dot)com>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: RE: postgres operational
Date: 2019-01-09 18:02:06
Message-ID: 17082AAFC33A934082836458CB53494374E45AA9@MONDB03.na.lzb.hq
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The best way I came up with for older versions is: If timeout -s 9 10 psql -d DBNAME -c "select 1" >/dev/null ; then ....

And on newer versions, use the pg_isready command.

Scot Kreienkamp |Senior Systems Engineer | La-Z-Boy Corporate
One La-Z-Boy Drive| Monroe, Michigan 48162 | Office: 734-384-6403 | | Mobile: 7349151444 | Email: Scot(dot)Kreienkamp(at)la-z-boy(dot)com
> -----Original Message-----
> From: Steve Clark [mailto:steve(dot)clark(at)netwolves(dot)com]
> Sent: Wednesday, January 9, 2019 12:59 PM
> To: pgsql <pgsql-general(at)postgresql(dot)org>
> Subject: postgres operational
>
> 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.
>
> Thanks,
> Steve
> --
>

This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message github kran 2019-01-09 18:10:09 Re: Pulling data from Postgres DB table for every 5 seconds.
Previous Message Rob Sargent 2019-01-09 18:01:23 Re: Pulling data from Postgres DB table for every 5 seconds.