-
Notifications
You must be signed in to change notification settings - Fork 321
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
database_exists throws error if username and db name are different for postgresql #472
Comments
I'm also seeing this problem. |
Can confirm this is an issue. Had to revert to 0.36.7. |
I see this observe this behavior:
|
I see this error on python 3.8.6 and 0.36.8 but don't see it on 0.36.7. Although, I think it has less to do with the python version and more to do with the |
This commit 5d99747 needs to be reversed. PostgreSQL needs to connect explicitly to the Current test cases only connect with |
Python 3.8 is still used in production, but in development env, it is time to upgrade to 3.9. There was issue with sqlalchemy-utils, downgrading it fixed the issue: kvesteri/sqlalchemy-utils#472
In my test environment, I have a user named "user" that only has access to a database named "test". If I run
database_exists("postgresql://user:password@localhost/test")
, I get the following error:sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: database "user" does not exist
.It looks like this behavior results from this line of code introduced in 5d99747
sqlalchemy-utils/sqlalchemy_utils/functions/database.py
Line 461 in 69f612a
With url.database set to None, the code assumes we are connecting to a database with the same name as the username.
The text was updated successfully, but these errors were encountered: