Pspg – Postgres Pager
github.com
github.com
My impression of the author went up 100%
To install pgcli, simply "pip install pgcli" at the command line.
When you pip install pgcli, the config file is located in ~/.config/pgcli/config
- The pager config line, which by default is commented out. You can define the pager to use pspg here, or leave it commented out and simply add something like this to your shell rc file: export PAGER="pspg -s 2"
- Check out syntax_style (I like monokai)
from within a pgcli terminal, F4 lets you switch into VIM mode
Also, play around with the table format in the pgcli config. I have yet to find a solid line grid but haven't stopped looking for it yet.
then, you get to combine the power of pgcli with pspg, for ultimate powahhhhh
=# select pg_sleep(10);
^CCancel request sent
ERROR: canceling statement due to user request
Time: 1269.674 ms (00:01.270)psql is the postgres bash,
pgcli is the postgres zsh,
pspg is the postgres midnight commander
Huh, I need to look into psql using less[0][1]. But having a look at the links it seems running `psql` in `tmux` with `^b[` for back buffer access with vim keys and regex search is how "I solved" this problem.
But in all honesty I normally find myself in pgadmin4.
[0]: http://merlinmoncure.blogspot.co.za/2007/10/better-psql-with... [1]: https://stackoverflow.com/questions/26257724/set-less-as-pag...
Also interesting to note, that people refer to the blue colors as "Midnight Commander Theme". I knew them as the colors of Norton Commander. :-)
https://unencumberedbyfacts.com/2016/01/04/psql-vim-happy-fa...
I've been using it for a few months, and it works great for me.
If you have to use less, -S (on command line or inside less, it works in both places) turns off line wrapping. It makes wide result sets workable and you can scroll left and right (but no freezing, naturally).
I like the combination of pgcli + pspg... now if there were only a way to graph stats a-la pgadmin!