Re: How to export query results to excel file using psql command in postgresql - Mailing list pgsql-general

From Pavel Stehule
Subject Re: How to export query results to excel file using psql command in postgresql
Date
Msg-id CAFj8pRCdEk-JAZw82ZfVfKFWPGcR2nzGbbxWDvjCAHApESX-9g@mail.gmail.com
Whole thread Raw
In response to How to export query results to excel file using psql command in postgresql  (Naveen Kumar <naveenmcp@gmail.com>)
List pgsql-general
Hi

čt 13. 8. 2020 v 16:10 odesílatel Naveen Kumar <naveenmcp@gmail.com> napsal:
How to export query results to excel file using psql command in postgresql

Excel can import csv file

so you can

for Postgres 12

\pset format csv
\o path_to_file
select * from ...

or for older postgres

\copy (select * from ...) to path_to_file CSV HEADER

Regards

Pavel

pgsql-general by date:

Previous
From: Naveen Kumar
Date:
Subject: How to export query results to excel file using psql command in postgresql
Next
From: Paul Förster
Date:
Subject: Re: How to export query results to excel file using psql command in postgresql