Is there a way to set the connection timeout using psql
cli? How can I set a connection timeout to something low like 3 seconds using the following:
PGPASSWORD=passwordhere psql -h 10.0.0.144 -U myuser -c "select 1" -d mydatabase
As far as I can tell, psql
does not support a connection timeout parameter. In the example above 10.0.0.144
is invalid and this command hangs for a long time. I need the command to fail fast if the host is incorrect.