agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Adrian Klaver <adrian.klaver@aklaver.com>
To: Günce Kaya <guncekaya14@gmail.com>
To: pgsql-admin@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] exporting query result
Date: Fri, 12 May 2017 09:07:19 -0700
Message-ID: <3d7d9782-0123-6d28-a661-a008ba3024e9@aklaver.com> (raw)
In-Reply-To: <CAAV2-mV_JLu5rqchgbZUALqHj3YfWGDcU8VpkTcES_YuwinhRQ@mail.gmail.com>
References: <CAAV2-mWJfp9iqpDn8pA11ofGc4RgDVKbUAwuHhXo95j=ooMULg@mail.gmail.com>
<4498cd4b-95b7-c4f5-add4-b6555267296a@aklaver.com>
<CAAV2-mV_JLu5rqchgbZUALqHj3YfWGDcU8VpkTcES_YuwinhRQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
On 05/12/2017 08:58 AM, Günce Kaya wrote:
> Hello,
>
> Thank you for your advice. But I did not want to ask about using Copy. I
> always use it but my requirement is if there is anyway to export query
> result to CSV's different sheets.
CSV != spreadsheet. You can export to CSV using COPY or \copy in psql
and then import those into a spreadsheet. If you want something that
creates an xls(x) file directly then that is going to require a third
party software. I use Python for doing stuff like that. Some programs I
use are:
Pandas
http://pandas.pydata.org/pandas-docs/stable/io.html
XlsxWriter
http://xlsxwriter.readthedocs.io/
csvkit
http://csvkit.readthedocs.io/en/1.0.2/
FYI, csvkit is a collection of command line tools, so it just needs
Python to be installed.
>
> Regards,
> Gunce Kaya
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
view thread (7+ messages) latest in thread
Message-ID: <3d7d9782-0123-6d28-a661-a008ba3024e9@aklaver.com>
Permalink: ../3d7d9782-0123-6d28-a661-a008ba3024e9@aklaver.com/
Also on: postgresql.org/message-id/3d7d9782-0123-6d28-a661-a008ba3024e9@aklaver.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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: adrian.klaver@aklaver.com, guncekaya14@gmail.com, pgsql-admin@postgresql.org
Subject: Re: [SQL] exporting query result
In-Reply-To: <3d7d9782-0123-6d28-a661-a008ba3024e9@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox