Re: Is the pg_isready database name relevant? - Mailing list pgsql-admin

From Ron Johnson
Subject Re: Is the pg_isready database name relevant?
Date
Msg-id CANzqJaAAmqHBe=hERcjbGQaTuiT3KX+d_eT-ed=-e1JeiT5snA@mail.gmail.com
Whole thread Raw
In response to Re: Is the pg_isready database name relevant?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
On Mon, Nov 24, 2025 at 1:30 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Ron Johnson <ronljohnsonjr@gmail.com> writes:
> This is something that *should* be fixed.

What do you think a fix would consist of?  The program is working
according to the design goals that were set for it.  In particular,
the objective is to test whether the server is up --- and if it
answers back with 'database "foo" does not exist', then yes it's
up.

Remove the database option.
 
  But at the same time, people might not wish to clutter their
server log with failed-connection messages, so we provide the
necessary options to make the test connection attempt a valid one.

Be thorough, or be really light.

These two do the exact same thing, but ncat can't generate a spurious log entry:
pg_isready -h foo || handle error
ncat -zw10 foo 5432 || handle error

while this does a thorough check:
psql -h foo -d bar -U snaggle -qXc "\q" || handle error

And they all execute in the same amount of time.

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Is the pg_isready database name relevant?
Next
From: "David G. Johnston"
Date:
Subject: Re: Is the pg_isready database name relevant?