-
Notifications
You must be signed in to change notification settings - Fork 544
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
Connecting via unix socket on a specific DB crashes pgcli #1422
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Hello
Installing pgcli 3.5.0 on a Debian server with postgresql 15, when, as unix user postgres, I run a simple
pgcli
, I get a proper prompt, but as soon as I usepgcli XXX
withXXX
being another database, pgcli crashes while starting because it tries to mix str and bytes.As you see, there are two type errors, and both relate to mixing str and bytes.
After poking a bit, it seems that when I give another database as an argument, pgcli connects to it and then makes queries to the postgres database to get the unix socket configuration and other stufs from the pg_settings database. In the case of a connection to the postgres database, the cursor fetches strings (eg in pgexecute.get_socket_directory function), while when connected to another database, the cursor fetches bytes.
I think some sanitizing is needed.
Your environment
pip freeze
command: nothing, I don't use pip. psycopg version is 3.1.7The text was updated successfully, but these errors were encountered: