Re: proposal: psql command \graw

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: psql command \graw
Date: 2017-08-23 12:55:09
Message-ID: CAFj8pRD9aMJLAyW6a--hv-yuwY-gHP9Hbbj28bp-uuSHZxJ_TQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2017-08-22 11:22 GMT+02:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

>
>
> 2017-08-22 10:46 GMT+02:00 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:
>
>>
>> Hello Pavel,
>>
>> 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 ...
>>>
>>
>> I understand that it is kind of a shortcut for:
>>
>> \pset fieldsep ' '
>> \pset format unaligned
>> \pset tuples_only on
>> -- possibly other settings...
>> SELECT * FROM data \g | gnuplot '...'
>
>
>> And then you have to persuade gnuplot to take its data from stdin?
>
>
> There are some methods
>
> https://stackoverflow.com/questions/17543386/pipe-plot-
> data-to-gnuplot-script/17576571#17576571
>
>
>
postgres=# select pocet_muzu + pocet_zen from obce
postgres-# \graw | gnuplot -p -e "set terminal dumb; plot '-' with boxes"

1.4e+06
+-+-----+-------+-------+--------+-------+-------+-------+-----+-+
+ + + + + + + +
+
| * '-' *******
|
1.2e+06 +-+ *
+-+
| *
|
1e+06 +-+ *
+-+
| *
|
| *
|
800000 +-+ *
+-+
| *
|
| *
|
600000 +-+ *
+-+
| *
|
| *
|
400000 +-+ * *
+-+
| * * *
|
200000 +-+ * * *
+-+
| * * * *
|
+ * * * +** * ** **** * * * * + *** ****
+
0
+-+-----****************************************************---+-+
-1000 0 1000 2000 3000 4000 5000 6000
7000

postgres=#

>
>>
>> --
>> Fabien.
>>
>
>

Attachment Content-Type Size
psql-graw.patch text/x-patch 5.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-08-23 13:36:40 Re: obsolete code in pg_upgrade
Previous Message Thomas Munro 2017-08-23 12:04:42 Re: POC: Sharing record typmods between backends