Comments (9)
Have you tried URL-escaping the @
to %40
?
from pgcli.
That's most definitely a bug. I wonder how psql handles this.
In the meantime you can try using the command line switches to prompt for the password instead of using the postgres:// style url.
pgcli -h localhost -p 5432 -U amjith -W app_db
Launching that way will prompt for the password.
from pgcli.
Have you tried with the latest pgcli? I successfully connected using a role with an '@' character using pgcli 0.16.0 against a 9.4 server:
postgres=# create role atpw LOGIN PASSWORD '@at';
CREATE ROLE
postgres=# create database atdb owner atpw;
CREATE DATABASE
postgres=# \q
$ pgcli postgres://atpw:@at@localhost:5432/atdb
Version: 0.16.0
Chat: https://gitter.im/amjith/pgcli
Mail: https://groups.google.com/forum/#!forum/pgcli
Home: http://pgcli.com
atdb>
from pgcli.
Previously I was using my own custom built parsing routine for extracting the password and username from the postgres url. I've replaced that routine with urlparse
from python stdlib. So this might not be an issue anymore.
Thanks @drocco007 for testing it. I'll close the issue.
from pgcli.
The issue seems to persist/have returned:
pgcli postgres://atpw:@at@localhost:5432/atdb
could not translate host name "at@localhost" to address: nodename nor servname provided, or not known
A workaround is to escape the @
s with sed:
pgcli postgres://atpw:"$(echo '@at'|sed -e s/@/\%40/g)"@localhost:5432/atdb
from pgcli.
@catando What is your pip freeze
output?
from pgcli.
for @
in password you need to encode @
with %40
and quote whole uri
ex: pgcli 'postgresql://postgres:%40postgres@localhost:5432/postgres'
also with arguments use same
ex: pgcli -h localhost -U postgres -W '@postgres' -d postgres
tested it works
from pgcli.
@j-bennet @amjith above solution work, so you can close issue (if need to add it in readme than I'll happy to contribute)
from pgcli.
@przdev A note in readme would be good, or better yet, in the docs on the pgcli.com
website. Here is the link to docs source:
https://github.com/dbcli/pgcli.com/blob/master/content/pages/3.docs.md
from pgcli.
Related Issues (20)
- Enhancement suggestion: inverted SELECT statements HOT 1
- Support `PGAPPNAME` for setting `application_name` HOT 1
- Connecting via unix socket on a specific DB crashes pgcli HOT 3
- pgcli disconnects when closing pager with `q` HOT 5
- Output to file in addition to the pager?
- Named Queries more user firendly
- [feature request] Unicode table HOT 1
- Using environment variables to connect via ssh HOT 2
- pgcli 4.0 - ModuleNotFoundError: No module named 'six' HOT 7
- pgcli.magic `conn.session.engine.url` raises AttributeError after breaking change upstream in ipython-sql
- Raised notices are printed backwards HOT 3
- Segfault on MacOs HOT 2
- Doesn't work with Python 3.11/Windows HOT 6
- Tab completion not working in version 4.0.1 on macOS
- pendulum dependency cannot be installed on 32-bit arches HOT 4
- Autocomplete not working for Apache AGE extension function names HOT 1
- Boolean type always show `false` HOT 9
- `invalid input syntax for type oid: "{oid}"` when running \d on an index HOT 4
- Per-database prompt colours HOT 1
- psycopg.errors.DataCorrupted: missing chunk number 0 for toast value 16386 in pg_toast_2619 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgcli.