new release pspg

Started by Pavel Stehuleover 5 years ago4 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

I released pspg 4.0.0 https://github.com/okbob/pspg/releases/tag/4.0.0

Now with the possibility to export content to file or clipboard in CSV,
TSVC, text or INSERT formats.

pspg is a pager like "less" or "more" designed specially for usage in TUI
database clients like "psql". It can work like a CSV viewer too.

https://github.com/okbob/pspg

Regards

Pavel

#2Bruce Momjian
bruce@momjian.us
In reply to: Pavel Stehule (#1)
Re: new release pspg

This is really cool. .... Now I just need to figure out how to
integrate it with using Emacs for my terminal. I still want to use
emacs enter and edit my queries but it would be cool to be able to hit
a key and launch an xterm and send the query output to pspg....

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Bruce Momjian (#2)
Re: new release pspg

Hi

ne 21. 3. 2021 v 7:40 odesílatel Greg Stark <stark@mit.edu> napsal:

This is really cool. .... Now I just need to figure out how to
integrate it with using Emacs for my terminal. I still want to use
emacs enter and edit my queries but it would be cool to be able to hit
a key and launch an xterm and send the query output to pspg....

a) you can run psql in emacs - and inside psql you can redirect output to
pipe. pspg can run in stream mode and can read data from pipe.

b) pspg can be used as a postgres client - the query can be pasted as a
command line argument.

Maybe stream mode can be enhanced about possibility to read queries from
pipe (not just data like now)

Regards

Pavel

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Bruce Momjian (#2)
Re: new release pspg

Hi

ne 21. 3. 2021 v 7:40 odesílatel Greg Stark <stark@mit.edu> napsal:

This is really cool. .... Now I just need to figure out how to
integrate it with using Emacs for my terminal. I still want to use
emacs enter and edit my queries but it would be cool to be able to hit
a key and launch an xterm and send the query output to pspg....

pspg 4.5.0 supports --querystream mode

run in one terminal /pspg --querystream -f ~/pipe --hold-stream=2 -h
localhost

and from any application, where you can write to stream, you can send a
queries separated by GS char 0x1d or ^] on separate line

[pavel@localhost src]$ cat /dev/tty > ~/pipe
select 1
^]
select * from pg_class limit
10
^]

Regards

Pavel