We are getting a connection error when we connect to a PostgreSQL database with a password that contains a ’ character.
With no escaping:
missing "=" after "'" in connection info string
If we escape the ’ into ‘’, like we do for other normal strings in the database, we get
missing "=" after "''" in connection info string
Escaping ' with \'
gives
FATAL: password authentication failed for user “passwordtest”
We’re using the built in PostgreSQL class. Xojo 2024r2.1
Is there a way around this?
Regards,
Lee
Just spitballing. What if you replace it with:
'\''
Escaping with '\''
gives missing "=" after "'" in connection info string
I’ve realised in another piece of software we are using the MonkeyBread plugins, and define the password as URLEncoded, so I’ll investigate and see if I can come up with the same
I think you already have to escape the ’ when setting it, like this:
ALTER USER myUser WITH PASSWORD ‘pa’‘ssword’;
Now you should be able to connect with ‘pa’‘ssword’ .
What I’ve ended up doing is URL Escaping passwords everywhere, so the '
character is escaped already so I can just use ALTER USER myuser WITH PASSWORD 'pass%27word'