Re: [HACKERS] proposal: psql command \graw

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [HACKERS] proposal: psql command \graw
Дата
Msg-id CAFj8pRD9aMJLAyW6a--hv-yuwY-gHP9Hbbj28bp-uuSHZxJ_TQ@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] proposal: psql command \graw  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [HACKERS] proposal: psql command \graw  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Hi

2017-08-22 11:22 GMT+02:00 Pavel Stehule <pavel.stehule@gmail.com>:


2017-08-22 10:46 GMT+02:00 Fabien COELHO <coelho@cri.ensmp.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




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.


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] POC: Sharing record typmods between backends
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] obsolete code in pg_upgrade