Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNbcN-008Fr2-3C for pgsql-admin@arkaria.postgresql.org; Mon, 24 Nov 2025 18:48:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNbcM-003AY5-1d for pgsql-admin@arkaria.postgresql.org; Mon, 24 Nov 2025 18:48:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNbcM-003AXw-0X for pgsql-admin@lists.postgresql.org; Mon, 24 Nov 2025 18:48:54 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vNbcK-001FYz-0T for pgsql-admin@lists.postgresql.org; Mon, 24 Nov 2025 18:48:53 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-3e80c483a13so3425407fac.2 for ; Mon, 24 Nov 2025 10:48:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764010132; x=1764614932; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=gewjtBKUl8cs3kS6sC6/vDa/LUVZY+I8sJndEdc9jGI=; b=ij/Sw2jRCpEzWIoWo4G+JdJ4Sn/v+X2rcQehQMI9aisWgKq/9HLjTvjvFeWOH/AKV7 LOXGrnPLipOyPXu0p/0/CjRDKjfkf5GvF8CtzjcsPt+TBsCcYXhztq0I9JaRnunpyvH7 I6MFngPZXIZYePI9Ii1PdzJ/TL2lGdMxs7WsJln+iWYhnrbeoUIi4vFiZuLIWCEZAuW2 hB45S2cBFgd6q13mDMnd+Oo2Zm3w1xyAwZWEaBff3g1JzsBj4D7BKJlhmOtuVE2jGtgH XZhaGzqD0CBpjjSFq3FkdUyOA8HYmmmYQza/3G4PBmmnWOGOnm1hpiQ4RFbXsiqkFBcB DNhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764010132; x=1764614932; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gewjtBKUl8cs3kS6sC6/vDa/LUVZY+I8sJndEdc9jGI=; b=Fpj6JIzdwGDkEw0GCw3eDLxX0PaZFIHXYiHOyul0AzxCoxpwJJefGVNHEUDmyJ6YCC jiul7Sa4jm07QAxZaXJu9zxYT8bQgFD0zyKEO7gVnUNkx0Ag0h9Qjz5vNCiWLscCKDWo ijMm4Hi+P3KyOUafoE0j+71Wc6sdnTzq3BM6CD0M7rpQH+M6xKrV9oHaEOMzEfFD/JAK cDmr28h/PQ7dIYD/7A28wOGLa+u7JDTXO68qICUn2HMeIH1MkajSzsiWzBlR4eodHE76 6QyyX3MJcuAx8JHfaTXnlBTgTTDG/+ObHHRMt7ookYobXhaHhb/jm8H9kTPuyRYcMfTY 0mrA== X-Gm-Message-State: AOJu0YzmnyX+6qgIV3oldzzTlRJCWoz83dLzw00OvqRxvOZb+Hzg/cZ4 91lvJrftpqEPgfWRKLXIzumUToYO7+VxJeWeVqAlowzQQbLbVg9TUaOVv43MH1t3yKB+iQi1zb+ x2AjzcL83N/0D3y8ROcRxXi1qSWxPguFCTHYZ X-Gm-Gg: ASbGnctJWQ1Cqe1sE1taW+lKZpapgipVj/vcKoNiS/gauNeClp5OXEzkEiZVocy5Vxa 7RIly8aY0L6HCQz3AnF+yMaoLfRwoUpss4EkQYdXrxO4eACWmub4tUh85/T5i7+vihCqGE7MQLT 3hWO8BdJExXYq49anUyLIo+4GhVdQnymNiUYd95NgWO63t3dlgBLesVKut4/8irWRgEBr7ufIDx t35Y7cuMSXt+Rk05evb/iQu5oMah5rIe9HPqArGLhdPLDfFBkYRIJ1UmC5t2ex/rDypYEDaceTw 3C6kghY= X-Google-Smtp-Source: AGHT+IHLh7nRloB/iIjp+GUUdvnFwhOn96ZCYkn/FHXWT2cel5x9gmh4CN40n89U4klQ+vac6wY8SdXnF8c/jzgMJ4k= X-Received: by 2002:a05:6808:5383:b0:450:3584:cda5 with SMTP id 5614622812f47-45115b0cd3cmr5270081b6e.55.1764010131842; Mon, 24 Nov 2025 10:48:51 -0800 (PST) MIME-Version: 1.0 References: <975822.1764009052@sss.pgh.pa.us> In-Reply-To: <975822.1764009052@sss.pgh.pa.us> From: Ron Johnson Date: Mon, 24 Nov 2025 13:48:40 -0500 X-Gm-Features: AWmQ_bmWKkunzd298C_cMGen51_BXzZ89lYGXe7bx6HuTgewpGSAYHqJ6quaTKg Message-ID: Subject: Re: Is the pg_isready database name relevant? To: Pgsql-admin Content-Type: multipart/alternative; boundary="00000000000049ebef06445b9de3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000049ebef06445b9de3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 24, 2025 at 1:30=E2=80=AFPM Tom Lane wrote: > Ron Johnson 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. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --00000000000049ebef06445b9de3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Nov 24, 2025 at 1:30=E2=80=AFPM T= om Lane <tgl@sss.pgh.pa.us> = wrote:
Ron Johnson <ronljohnsonjr@gmail.com> write= s:
> This is something that *should* be fixed.

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

Remove the database option.
= =C2=A0
=C2=A0 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 543= 2=C2=A0|| handle error

while= this does a thorough=C2=A0check:
psql -= h foo -d bar -U snaggle -qXc "\q"=C2=A0|| handle e= rror

And they all execute in the same amoun= t of time.

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