Re: BUG #19002: `pg_isready` unexpectedly succeeds on incorrect `--dbname` and/or `--username`

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: samuelmarks(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19002: `pg_isready` unexpectedly succeeds on incorrect `--dbname` and/or `--username`
Date: 2025-07-29 19:54:43
Message-ID: CAOYmi+mAWLmb6egMet8LFy_vDC7euHLFHQnFjL36MiFrjvySTg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jul 29, 2025 at 12:45 PM PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> / > pg_isready -U fff
> /tmp:5432 - accepting connections
> / > pg_isready -U fff -d555
> /tmp:5432 - accepting connections
> ```
>
> (`fff` is not a user and `555` is not a db on my installation)

Hi Samuel, this behavior is explained in the docs [1]:

> It is not necessary to supply correct user name, password, or database name values to obtain the server status; however, if incorrect values are provided, the server will log a failed connection attempt.

So it's essentially just a courtesy to whoever's watching your logs.

--Jacob

[1] https://www.postgresql.org/docs/current/app-pg-isready.html#APP-PG-ISREADY-NOTES

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Davis 2025-07-29 23:33:45 CREATE DATABASE copies datlocale even if datlocprovider differs
Previous Message PG Bug reporting form 2025-07-29 19:11:03 BUG #19002: `pg_isready` unexpectedly succeeds on incorrect `--dbname` and/or `--username`