3 ms·
I've been really happily using pgcli for the last couple years. I really like it. It has all of the upside of psql but with added benefits that don't get in the
by asdfghjklkjhgf 6y ago
I've been really happily using pgcli for the last couple years. I really like it. It has all of the upside of psql but with added benefits that don't get in the way and are configurable. If you use psql, I believe it's pretty much a drop-in replacement and worth the minimal effort to try out. I personally switched from a GUI client, since I had been missing the psql backslash commands for a while
- mulmen 6y agoI use psql for quick exploration and simple queries. Just installed pgcli through brew but it blew up trying to use the services defined in .pg_service. Maybe I need to set an alias to a connection string. Not exactly a drop-in though. This does look very promising so thanks for the suggestion.
- pasenor 6y agoIn what way did it blow up? You must have hit a bug, using .pg_service should work. Would you care to open an issue on https://github.com/dbcli/pgcli/issues https://github.com/dbcli/pgcli/issues or just dump the error message here so we can investigate?
- mulmen 6y agomulmen@hostname ~> pgcli service=mulmen@db Traceback (most recent call last): File "/usr/local/bin/pgcli", line 33, in <module> sys.exit(load_entry_point('pgcli==3.1.0', 'console_scripts', 'pgcli')()) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/click/core.py", line 829, in __call__ return self.main(*args, \*kwargs) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, \*ctx.params) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/click/core.py", line 610, in invoke return callback(*args, \*kwargs) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/pgcli/main.py", line 1311, in cli pgcli.connect_service(service, user) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/pgcli/main.py", line 479, in connect_service service_config, file = parse_service_info(service) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/pgcli/main.py", line 1508, in parse_service_info service_file_config = ConfigObj(service_file) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/configobj.py", line 1229, in __init__ self._load(infile, configspec) File "/usr/local/Cellar/pgcli/3.1.0/libexec/lib/python3.9/site-packages/configobj.py", line 1318, in _load raise error configobj.ParseError: Invalid line ('PG Service File for saved connection parameters') (matched as neither section nor keyword) at line 1. Looks like it blew up on a comment line at the top of the file. For some reason the file did not have a # before the comment but psql happily ignores that. I added a # and pgcli loads properly.
- pasenor 6y agoNice to hear that it works! I can reproduce it, psql does seem to handle arbitrary text before the first section of .pg_service.conf. Weird. We'll add a workaround as well.
- mulmen 6y agoI'm curious how I ended up with that line there actually. Maybe it was a copy-paste that missed a character? Maybe it was an example I grabbed somewhere? I searched but the only occurrence of that string on the indexed web seems to be my own comment. So maybe I did this to myself.