Re: Is the pg_isready database name relevant?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Is the pg_isready database name relevant?
Date: 2025-11-24 18:48:40
Message-ID: CANzqJaAAmqHBe=hERcjbGQaTuiT3KX+d_eT-ed=-e1JeiT5snA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Nov 24, 2025 at 1:30 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Ron Johnson <ronljohnsonjr(at)gmail(dot)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!

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2025-11-24 21:54:19 Re: Is the pg_isready database name relevant?
Previous Message Tom Lane 2025-11-24 18:47:43 Re: Is the pg_isready database name relevant?