This project is archived and is in readonly mode.
Specials characters in password
-
Daniele Varrazzo
Please specify better: are you creating the connection using a connection string:
cnn = psycopg2.connect("dbname=foo password=abc")or using separate arguments?
cnn = psycopg2.connect(database="foo" password="abc")Does anything change switching method?
Can you connect via psql using exactly the same connection string of the first case?
psql "dbname=foo password=abc"Thank you.
-
Daniele Varrazzo
- State changed from new to invalid
Can't confirm the issue: I've tried creating an user with password
@#!*and@#'"!*and found no problem connecting with either methods.cnn = psycopg2.connect(user='testpw', password='@#!*' database='piro') cnn = psycopg2.connect('user=testpw password=@#!* dbname=piro') cnn = psycopg2.connect(user='testpw', password='@#\'"!*', database='piro') cnn = psycopg2.connect(r"""user=testpw password='@#\'"!*' dbname=piro""")In the last case the password must be escaped according to the PQconnectdb rule: the rule is applied authomatically in the 3rd example.
Tested with psycopg 2.5 and postgres 9.2.4.
Please reopen if you can provide a failing example and report postgres and psycopg versions.