sasha-alias / sqltabs

Rich SQL client for Postgresql, MySQL, MS SQL, Amazon Redshift, Google Firebase (Firestore)
https://www.sqltabs.com
GNU General Public License v3.0
803 stars 57 forks source link

Connection to Postgres fails for passwords containing hashtags # #170

Open jackrsteiner opened 3 years ago

jackrsteiner commented 3 years ago

When attempting to connect to a PostgreSQL 13.4 instance, I found passwords containing the # character would result in failure:

getaddrinfo EAI_AGAIN postgres postgres:5432

Worth noting, this instance isn't at port 5432, so a bit of an odd error message.

A post on stackexchange claims that the node-postgres package doesn't accept passwords containing hashtags. The recommendation is to encode passwords using encodeURIComponent. For example:

const userPasswordDatabase = ${encodeURIComponent(database.dbPassword)}@;