Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not attempt to connect to postgres database in detached mode #653

Open
zx80 opened this issue Sep 18, 2022 · 3 comments
Open

Should not attempt to connect to postgres database in detached mode #653

zx80 opened this issue Sep 18, 2022 · 3 comments

Comments

@zx80
Copy link

zx80 commented Sep 18, 2022

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.

@fizyk
Copy link
Member

fizyk commented Sep 26, 2022

🤔 What is the detached mode?

@zx80
Copy link
Author

zx80 commented Sep 27, 2022

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.

@fizyk
Copy link
Member

fizyk commented Nov 7, 2022

related #672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants