Samuel Marks <samuelmarks@gmail.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