Re: psql format result as markdown tables

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Nicolas Paris <niparisco(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql format result as markdown tables
Date: 2018-01-13 22:10:43
Message-ID: CANu8Fiz5gf1j6FpF+dcrftZdHz83VAAqLEaAbX0H+o0feckCcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jan 13, 2018 at 4:50 AM, Nicolas Paris <niparisco(at)gmail(dot)com> wrote:

> Hello
>
> I wonder if someone knows how to configure psql to output results as
> markdown tables.
> Then instead of :
>
> SELECT * FROM (values(1,2),(3,4)) as t;
> column1 | column2
> ---------+---------
> 1 | 2
> 3 | 4
>
> Get the result as :
> SELECT * FROM (values(1,2),(3,4)) as t;
> | column1 | column2|
> |---------|--------|-
> | 1 | 2|
> | 3 | 4|
>
> Thanks by advance
>
>
*A. You have not graced us with PostgreSQL version and O/S*
*B. Your two examples appear exactly the same.*
*C. Have you looked at https://donatstudios.com/CsvToMarkdownTable
<https://donatstudios.com/CsvToMarkdownTable> ?*

*Found with a google search of .... sql markdown table*

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2018-01-13 22:19:58 Re: psql format result as markdown tables
Previous Message Tom Lane 2018-01-13 17:08:39 Re: Postgres 9.4 using primary key index in almost all queries leading to degraded performance