Thread: Adding Markodwn formatting to psql output

Adding Markodwn formatting to psql output

From
Lætitia Avrot
Date:
Hi,

I write often documents for my customers in MarkDown to produce pdf documents. Quite often, I need to present data from queries in a tabular form.

Psql output provides formatting in text (aligned and unaligned), HTML, latex, JSON (and so many more) but not in MarkDown. The aligned output is quite similar to the MarkDown output. It seems quite easy to develop (so, pretty great for my first real patch). To toggle it, I imagine, we could use `pset markdown`.

My colleague (Jean-Christophe Arnu) and I worked a little on it, but I think the difficulty lies in the "Do we want/need to add that feature ?" question.

On the Pros side, I have "I would love it and use it all the time". On the Cons side, I have "There are multiple flavors of markdown, which one do we need to implement".

Any thoughts ?

Regards,

Lætitia
--
Think! Do you really need to print this email ?
There is no Planet B.

Re: Adding Markodwn formatting to psql output

From
Euler Taveira
Date:
2018-05-29 12:11 GMT-03:00 Lætitia Avrot <laetitia.avrot@gmail.com>:
> I write often documents for my customers in MarkDown to produce pdf
> documents. Quite often, I need to present data from queries in a tabular
> form.
>

https://www.postgresql.org/message-id/flat/CAAYBy8YU4pXYKDHeQhsA_=FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com#CAAYBy8YU4pXYKDHeQhsA_=FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com


--
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


Re: Adding Markodwn formatting to psql output

From
Lætitia Avrot
Date:


Le mar. 29 mai 2018 à 17:28, Euler Taveira <euler@timbira.com.br> a écrit :
2018-05-29 12:11 GMT-03:00 Lætitia Avrot <laetitia.avrot@gmail.com>:
> I write often documents for my customers in MarkDown to produce pdf
> documents. Quite often, I need to present data from queries in a tabular
> form.
>
https://www.postgresql.org/message-id/flat/CAAYBy8YU4pXYKDHeQhsA_=FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com#CAAYBy8YU4pXYKDHeQhsA_=FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com
Thanks a lot!

 It seems that other people need that feature too. :-)

I will try to apply and review the patch.

--
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


--
Think! Do you really need to print this email ?
There is no Planet B.

Re: Adding Markodwn formatting to psql output

From
Bruce Momjian
Date:
On Tue, May 29, 2018 at 06:47:54PM +0200, Lætitia Avrot wrote:
> 
> 
> Le mar. 29 mai 2018 à 17:28, Euler Taveira <euler@timbira.com.br> a écrit :
> 
>     2018-05-29 12:11 GMT-03:00 Lætitia Avrot <laetitia.avrot@gmail.com>:
>     > I write often documents for my customers in MarkDown to produce pdf
>     > documents. Quite often, I need to present data from queries in a tabular
>     > form.
>     >
>     https://www.postgresql.org/message-id/flat/CAAYBy8YU4pXYKDHeQhsA_=
>     FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com#CAAYBy8YU4pXYKDHeQhsA_=
>     FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com
> 
> Thanks a lot!
> 
>  It seems that other people need that feature too. :-)
> 
> I will try to apply and review the patch.

Uh, no one mentioned in this thread that psql has supported asciidoc
since PG 9.5.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +


Re: Adding Markodwn formatting to psql output

From
Alvaro Herrera
Date:
On 2018-Jun-23, Bruce Momjian wrote:

> On Tue, May 29, 2018 at 06:47:54PM +0200, Lætitia Avrot wrote:
> > 
> > 
> > Le mar. 29 mai 2018 à 17:28, Euler Taveira <euler@timbira.com.br> a écrit :
> > 
> >     2018-05-29 12:11 GMT-03:00 Lætitia Avrot <laetitia.avrot@gmail.com>:
> >     > I write often documents for my customers in MarkDown to produce pdf
> >     > documents. Quite often, I need to present data from queries in a tabular
> >     > form.
> >     >
> >     https://www.postgresql.org/message-id/flat/CAAYBy8YU4pXYKDHeQhsA_=
> >     FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com#CAAYBy8YU4pXYKDHeQhsA_=
> >     FC93yOBZp5j1h=BSSAo9-oLcwNww@mail.gmail.com
> > 
> > Thanks a lot!
> > 
> >  It seems that other people need that feature too. :-)
> > 
> > I will try to apply and review the patch.
> 
> Uh, no one mentioned in this thread that psql has supported asciidoc
> since PG 9.5.

I would welcome markdown output, particularly some version that can be
processed nicely by pandoc :-)

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: Adding Markodwn formatting to psql output

From
Vik Fearing
Date:
On 23/06/18 17:01, Alvaro Herrera wrote:
> On 2018-Jun-23, Bruce Momjian wrote:
> 
>> On Tue, May 29, 2018 at 06:47:54PM +0200, Lætitia Avrot wrote:
>>>
>>> I will try to apply and review the patch.
>>
>> Uh, no one mentioned in this thread that psql has supported asciidoc
>> since PG 9.5.
> 
> I would welcome markdown output, particularly some version that can be
> processed nicely by pandoc :-)

I use latex format for that, but I also welcome a markdown format.
-- 
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support