On 16 June 2016 at 00:40, Jimmy <jimmyj...@gmail.com> wrote: > > (1) I can (and do) use psql, pg_isready seems lighter and since it already > supports credentials and DB name, I see very little harm for pg_isready > to say back whether user logged IN or not using these credentials. > > > (2) timeout is not the same - timeout does not retry, its a simple timeout > in case connection hangs, try it > >> That threw me recently, too.
If your DB is in recovery, pg_isready with a long timeout won't wait until it's accepting normal user connections or until timeout. There's no way to get that behaviour without a shell script loop or similar. So yeah, +1 for this. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services