Should not attempt to connect to `postgres` database in detached mode
What action do you want to perform
Use postgresql in detached mode on a standard pg account and database:
createuser pytest # with password "pytest"
createdb -O pytest pytest
pytest --postgresql-detached --postgresql-user=pytest --postgresql-password=pytest --postgreqsl-dbname=pytest ...
What are the results
The connection fails because it attempts to connect to the postgres database.
This is hardcoded here.
What are the expected results
It should use the provided dbname to get the version, and succeed.
🤔 What is the detached mode?
Sorry, this option is added by the script. It triggers using _noproc instead of _proc, i.e. it uses an existing server where the database user does not have access to postgres, which makes sense for a non super-user database account.
Postgres command psql -l connects to postgres only if no database name is provided, so I think that the connection should do the same and use dbname or "postgres" as a database target.
related #672