8 ms·
Pspg – Postgres Pager
- abstrct 9y agoLooks great! I'm excited to try this out
- jdonaldson 9y ago"If you like it, send a postcard from your home country to my address, please" My impression of the author went up 100%
- mtmail 9y agohttps://en.m.wikipedia.org/wiki/Postcardware https://en.m.wikipedia.org/wiki/Postcardware
- rmetzler 9y agoLooks like a very interesting project. Could it be used with sqlite or Mysql? Also interesting to note, that people refer to the blue colors as "Midnight Commander Theme". I knew them as the colors of Norton Commander. :-)
- barrkel 9y agoNot bad, I like the column freeze feature. 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).
- sourcesmith 9y agoYou could also use \x auto in .psqlrc to have it switch to vertical display of records when they are too wide to display horizontally.
- vittore 9y agoNot bad but i like pgcli (pgcli.com) display of tabular data better. besides it is not just that, it is such a nice command line tool for pg. That autocomplete is a killer!
- scrollaway 9y agoEdit: Nevermind! I was looking at a broken psql shim.
- willlll 9y agoThis is not correct. ctrl+c cancels the query and does not quit psql: =# select pg_sleep(10); ^CCancel request sent ERROR: canceling statement due to user request Time: 1269.674 ms (00:01.270)
- deleted 9y ago[deleted]
- y4mi 9y agolet me preface this my mentioning that i didn't actually install the pager, i'm writing this after looking at the demo and reading the readme. psql is the postgres bash, pgcli is the postgres zsh, pspg is the postgres midnight commander
- iracic 9y agoI use it for some time. No need to challenge your eyes with long lines or json values anymore. This kind of result presentation should be in each command line client. Very very useful.
- cup-of-tea 9y agoThis looks good, but why is it specific to postgres? Can't something like this be used with any tabular data?
- okbobcz 9y agoI checked it, and I hope so MySQL can be supported too. pspg is just pager - it is not data formatter, so raw data like CSV cannot be processed there. But if some tool translate data to MySQL or PostgreSQL tabular format, then this pager can be used.
- okbobcz 9y agopspg supports mysql and pgcli now
- ktpsns 9y agoIt's so good that people still write high quality command line utilities in the time everybody runs copies of browser engines for their editor and messenger on the desktop (refereing to Electron, Atom, Slack). Especially when managing servers over ssh (or ssh tunneled throught ssh tunneled thought ssh), good utilities are invaluable.
- MuffinFlavored 9y agoThis actually raises a good question. Are operating systems going to like, incorporate a "WebKit daemon" so that multiple instances of the browser backend aren't loaded individually in every app?
- Dowwie 9y agoI recommend using pspg in conjunction with pgcli. 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
- oneweekwonder 9y ago> Everybody who uses psql uses less pager. 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-less.html http://merlinmoncure.blogspot.co.za/2007/10/better-psql-with... [1]: https://stackoverflow.com/questions/26257724/set-less-as-pager-in-psql https://stackoverflow.com/questions/26257724/set-less-as-pag...
- agentultra 9y agoNice work! Cool project. I like the combination of pgcli + pspg... now if there were only a way to graph stats a-la pgadmin!
- Torgo 9y agoI have been using this for an hour, and it's already indispensable in my eyes.
- digisth 9y agoIf one prefers to use vim as a pager for psql, try this: https://unencumberedbyfacts.com/2016/01/04/psql-vim-happy-face/ 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.