psql format result as markdown tables

From: Nicolas Paris <niparisco(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: psql format result as markdown tables
Date: 2018-01-13 09:50:55
Message-ID: 20180113095053.dlf6mj32wxqqgcgk@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2018-01-13 10:33:31 Re: Missing WAL file after running pg_rewind
Previous Message Rahul Sharma 2018-01-13 06:37:17 Postgres 9.4 using primary key index in almost all queries leading to degraded performance