pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

Pgcli incompatible with Azure Postgres username

Open aronneagu opened this issue 6 years ago • 2 comments

Description

Azure specific postgres databases cannot be set as DSN Azure Postgres users are in the format of user@server_name, and the extra @ confuses pgcli For example one entry in config db001 = postgres://admin@dev-db001:[email protected]:5432/postgres?sslmode=require

Running pgcli -D db001 returns invalid port number: "[email protected]:5432"

Your environment

Running on Windows 10, Debian 9.6 WSL

$ pgcli --version
Version: 2.1.1

pip freeze

adal==1.2.1
aiven-client==2.2.3
anaconda-client==1.7.2
ansible==2.8.4
arrow==0.13.1
asn1crypto==0.24.0
atomicwrites==1.3.0
attrs==19.1.0
bcrypt==3.1.6
braceexpand==0.1.2
certifi==2019.3.9
cffi==1.11.5
chardet==3.0.4
cli-helpers==1.2.0
Click==7.0
clyent==1.2.2
conda==4.6.14
configobj==5.0.6
cryptography==2.4.2
decorator==4.3.2
docopt==0.6.2
fvi==1.2.0
humanize==0.5.1
idna==2.8
inform==1.15.0
ipython-genutils==0.2.0
isodate==0.6.0
Jinja2==2.10
jmespath==0.9.4
jmespath-terminal==0.2.1
jsonschema==2.6.0
jupyter-core==4.4.0
MarkupSafe==1.1.0
more-itertools==7.0.0
msrest==0.6.6
msrestazure==0.6.0
nbformat==4.4.0
oauthlib==3.0.1
paramiko==2.4.2
pathspec==0.5.9
pg-activity==1.5.0
pgcli==2.1.1
pgspecial==1.11.5
pluggy==0.11.0
prompt-toolkit==2.0.9
psutil==5.6.2
psycopg2==2.7.7
psycopg2-binary==2.8.1
py==1.8.0
pyasn1==0.4.5
pycosat==0.6.3
pycparser==2.19
Pygments==2.3.1
PyJWT==1.7.1
PyNaCl==1.3.0
pyOpenSSL==18.0.0
PySocks==1.6.8
pytest==4.4.2
python-dateutil==2.7.5
pytz==2018.9
PyYAML==3.13
requests==2.21.0
requests-oauthlib==1.2.0
ruamel-yaml==0.15.46
setproctitle==1.1.10
shlib==1.1.0
six==1.12.0
sqlparse==0.3.0
tabulate==0.8.3
terminaltables==3.1.0
traitlets==4.3.2
urllib3==1.24.1
urwid==1.2.2
wcwidth==0.1.7
xmltodict==0.12.0
yamllint==1.15.0

aronneagu avatar Aug 21 '19 15:08 aronneagu

Try use code %40 instead @ symbol in username

suupaafly avatar Apr 21 '20 19:04 suupaafly

Use a 'Keyword/Value Connection String':

pgcli "user=admin@dev-db001 password=password host=dev-db001.postgres.database.azure.com dbname=postgres sslmode=require"

ludovicc avatar Aug 12 '20 15:08 ludovicc

This issue is 4 years old and has received 2 answers (thanks to you both!). No news for 3 years, I am closing this issue.

dbaty avatar Nov 15 '23 20:11 dbaty