Re: How to export query results to excel file using psql command in postgresql

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: Naveen Kumar <naveenmcp(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to export query results to excel file using psql command in postgresql
Date: 2020-08-13 14:15:21
Message-ID: DB4C59C6-9FF6-48F9-B82E-12316D8E9B2B@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Naveen,

> On 13. Aug, 2020, at 16:10, Naveen Kumar <naveenmcp(at)gmail(dot)com> wrote:
>
> How to export query results to excel file using psql command in postgresql

use the "copy" command along with its CSV output setting. Then open the CSV file with Excel.

Look here:

https://www.postgresqltutorial.com/export-postgresql-table-to-csv-file/

https://www.postgresql.org/docs/current/sql-copy.html

Cheers,
Paul

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-08-13 14:15:38 Re: How to export query results to excel file using psql command in postgresql
Previous Message Pavel Stehule 2020-08-13 14:15:08 Re: How to export query results to excel file using psql command in postgresql