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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Samuel Marks <samuelmarks(at)gmail(dot)com>
Cc: Jacob Champion <jacob(dot)champion(at)enterprisedb(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-30 03:27:35
Message-ID: 1404833.1753846055@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Samuel Marks <samuelmarks(at)gmail(dot)com> writes:
> Hmm I suppose that works, but really I was using it as a "can i connect"
> check.

That's explicitly not its job. Why don't you just try to connect?
Or if you want a command-line tool, consider

psql ...connection options... -c 'select 1'

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message vignesh C 2025-07-30 10:54:04 Re: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database
Previous Message shveta malik 2025-07-30 03:15:20 Re: Unexpected Standby Shutdown on sync_replication_slots change