Re: proposal: psql command \graw

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: psql command \graw
Date: 2017-08-22 09:29:16
Message-ID: CAFj8pRD8KpAdZGTsWWeQbz5Jb=fU7h2h3HBvr9_NH26Aj7iExw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2017-08-22 10:36 GMT+02:00 Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>:

> Hi Pavel,
>
> > I am thinking about printing graphs in psql (mainly some histograms). I
> > found so gnuplot is able do very good graphs in console. The one issue is
> > user friendly (with less steps) generating data in good format for this
> > application.
> >
> > One my idea is introduction new simple output format and execution
> command
> > with result in this format.
> >
> > It should work something like
> >
> > \setenv GNUPLOT_OPTION '......'
> >
> > SELECT * FROM data
> >
> > \graw | gnuplot ...
> >
> > It can be used for any other applications R, ggplot, ..
> >
> > Ideas, comments?
>
> Sounds cool. On the other hand, I think it's kind of too domain specific
> task. So I wonder whether it could be generalized somehow so anyone
> could write an extension that would export data in any format in a
> friendly way.
>
> For instance:
>
> create extension export_to_gnuplot;
> select * from data
> \export_to_gnuplot | gnuplot ...
>

you are mixing server side and client side code. Maybe some time we can
write psql custom commands.

can be nice to have more pipes in series

so you can do

select * from data
\graw | histogram | gnuplot ...

>
> --
> Best regards,
> Aleksander Alekseev
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-08-22 10:25:12 Re: Page Scan Mode in Hash Index
Previous Message Pavel Stehule 2017-08-22 09:22:57 Re: proposal: psql command \graw