Pages

Monday, April 6, 2020

new pspg - version 3.0.2 with named pipe support

Today I released version 3.0.2. The ui is same like older versions. New is a possibility to communicate with client via named pipe. Now pspg can work well with redirected content (\o command in psql and psql watch mode is supported too.

Example:
#create named pipe
mkfifo ~/pipe

#use psql
[pavel@nemesis ~]$ psql
psql (13devel)
Type "help" for help.

postgres=# \o ~/pokus
postgres=# select * from obce limit 10;
postgres=# --redirect content to pipe
postgres=# \o ~/pipe
postgres=# select current_timestamp;
postgres=# -- repeat it every 1sec
postgres=# \watch 1

In other terminal - run pspg and read from pipe
pspg -f ~/pipe

By default pspg is ending when writer program is closed. This behave can be changed with option --hold-stream to 1 (reopen) or 2 (nonstop opened).




No comments:

Post a Comment