Open P-EB opened 1 year ago
@P-EB Thank you for reporting. What's the python version, and how did you install pgcli (you said it was not pip
)?
Via apt
, as I'm using Debian.
Python3 version is 3.11.5
@j-bennet in case you did not see it I replied to your question.
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.7