TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pspg – Postgres Pager

135 pointsby willlllover 7 years ago

13 comments

jdonaldsonover 7 years ago
&quot;If you like it, send a postcard from your home country to my address, please&quot;<p>My impression of the author went up 100%
评论 #15713285 未加载
Dowwieover 7 years ago
I recommend using <i>pspg</i> in conjunction with <i>pgcli</i>.<p>To install pgcli, simply &quot;pip install pgcli&quot; at the command line.<p>When you pip install pgcli, the config file is located in ~&#x2F;.config&#x2F;pgcli&#x2F;config<p>- 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=&quot;pspg -s 2&quot;<p>- Check out syntax_style (I like monokai)<p>from within a pgcli terminal, F4 lets you switch into VIM mode<p>Also, play around with the table format in the pgcli config. I have yet to find a solid line grid but haven&#x27;t stopped looking for it yet.<p>then, you get to combine the power of pgcli with pspg, for ultimate powahhhhh
ktpsnsover 7 years ago
It&#x27;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.
评论 #15714251 未加载
vittoreover 7 years ago
Not 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!
评论 #15712441 未加载
评论 #15711638 未加载
评论 #15710812 未加载
oneweekwonderover 7 years ago
&gt; Everybody who uses psql uses less pager.<p>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 &quot;I solved&quot; this problem.<p>But in all honesty I normally find myself in pgadmin4.<p>[0]: <a href="http:&#x2F;&#x2F;merlinmoncure.blogspot.co.za&#x2F;2007&#x2F;10&#x2F;better-psql-with-less.html" rel="nofollow">http:&#x2F;&#x2F;merlinmoncure.blogspot.co.za&#x2F;2007&#x2F;10&#x2F;better-psql-with...</a> [1]: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;26257724&#x2F;set-less-as-pager-in-psql" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;26257724&#x2F;set-less-as-pag...</a>
rmetzlerover 7 years ago
Looks like a very interesting project. Could it be used with sqlite or Mysql?<p>Also interesting to note, that people refer to the blue colors as &quot;Midnight Commander Theme&quot;. I knew them as the colors of Norton Commander. :-)
digisthover 7 years ago
If one prefers to use vim as a pager for psql, try this:<p><a href="https:&#x2F;&#x2F;unencumberedbyfacts.com&#x2F;2016&#x2F;01&#x2F;04&#x2F;psql-vim-happy-face&#x2F;" rel="nofollow">https:&#x2F;&#x2F;unencumberedbyfacts.com&#x2F;2016&#x2F;01&#x2F;04&#x2F;psql-vim-happy-fa...</a><p>I&#x27;ve been using it for a few months, and it works great for me.
barrkelover 7 years ago
Not bad, I like the column freeze feature.<p>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).
评论 #15711772 未加载
iracicover 7 years ago
I 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.
agentultraover 7 years ago
Nice work! Cool project.<p>I like the combination of pgcli + pspg... now if there were only a way to graph stats a-la pgadmin!
Torgoover 7 years ago
I have been using this for an hour, and it&#x27;s already indispensable in my eyes.
abstrctover 7 years ago
Looks great! I&#x27;m excited to try this out
cup-of-teaover 7 years ago
This looks good, but why is it specific to postgres? Can&#x27;t something like this be used with any tabular data?
评论 #15720208 未加载
评论 #15734865 未加载