pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Förster <paul.foerster@gmail.com>
To: Naveen Kumar <naveenmcp@gmail.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: How to export query results to excel file using psql command in postgresql
Date: Thu, 13 Aug 2020 16:15:21 +0200
Message-ID: <DB4C59C6-9FF6-48F9-B82E-12316D8E9B2B@gmail.com> (raw)
In-Reply-To: <CAN+uLsGivA_mG0vX=qos0JZEsqA9yqkmAxDkV_TjuVXXJ6CvXg@mail.gmail.com>
References: <CAN+uLsGivA_mG0vX=qos0JZEsqA9yqkmAxDkV_TjuVXXJ6CvXg@mail.gmail.com>

Hi Naveen,

> On 13. Aug, 2020, at 16:10, Naveen Kumar <naveenmcp@gmail.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




view thread (4+ messages)  latest in thread

Message-ID: <DB4C59C6-9FF6-48F9-B82E-12316D8E9B2B@gmail.com>
Permalink:  ../DB4C59C6-9FF6-48F9-B82E-12316D8E9B2B@gmail.com/
Also on:    postgresql.org/message-id/DB4C59C6-9FF6-48F9-B82E-12316D8E9B2B@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: paul.foerster@gmail.com, naveenmcp@gmail.com
  Subject: Re: How to export query results to excel file using psql command in postgresql
  In-Reply-To: <DB4C59C6-9FF6-48F9-B82E-12316D8E9B2B@gmail.com>
  References: <CAN+uLsGivA_mG0vX=qos0JZEsqA9yqkmAxDkV_TjuVXXJ6CvXg@mail.gmail.com> <DB4C59C6-9FF6-48F9-B82E-12316D8E9B2B@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox