grafana / grafana/xk6-sql

PostgreSQL connection string special character issues

Open
#21 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
190
Forks
65
Avg merge
2d 11h
Merged PRs (30d)
10

Description

Hi I'm having an issue connecting to a PostgreSQL SB where the password contains special characters.

if my password is abc#123, and I create a connection string like:
`postgres://myusername:abc%23123@db.host/mydb`

where **#** is escaped to be **%23** as required by PostgreSQL. I get the following error when I try to connect:

`const db = sql.open('postgres', 'postgres://myusername:abc%23123@db.host/mydb');`

`ERRO[0005] GoError: parse "postgres://myusername:abc%!?(MISSING)k@db.host/mydb": invalid port ":abc%!"(MISSING) after host`

How should can I connect to PostgreSQL DBs where a password contains a special character? Please help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.