agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedexporting query result
7+ messages / 3 participants
[nested] [flat]
* exporting query result
@ 2017-05-12 09:14 Günce Kaya <guncekaya14@gmail.com>
2017-05-12 13:12 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 1 reply; 7+ messages in thread
From: Günce Kaya @ 2017-05-12 09:14 UTC (permalink / raw)
To: pgsql-admin@postgresql.org; pgsql-sql
Good morning all,
I use COPY to exporting query result but I'm curious If there is any way to
export query result to a CSV file's different spreadsheets through Pgadmin
or server?
Regards
--
Gunce Kaya
Linkedin <https://tr.linkedin.com/in/guncekaya; - Twitter
<https://twitter.com/gguncesi; - Blog
<http://www.guncekaya.blogspot.com.tr/;
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [SQL] exporting query result
2017-05-12 09:14 exporting query result Günce Kaya <guncekaya14@gmail.com>
@ 2017-05-12 13:12 ` Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 15:58 ` Re: [SQL] exporting query result Günce Kaya <guncekaya14@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Adrian Klaver @ 2017-05-12 13:12 UTC (permalink / raw)
To: Günce Kaya <guncekaya14@gmail.com>; pgsql-admin@postgresql.org; pgsql-sql
On 05/12/2017 02:14 AM, Günce Kaya wrote:
> Good morning all,
>
> I use COPY to exporting query result but I'm curious If there is any way
> to export query result to a CSV file's different spreadsheets through
> Pgadmin or server?
You can export to CSV using COPY. For pgAdmin see:
https://www.pgadmin.org/docs/pgadmin4/1.x/import_export_data.html?highlight=csv
If this is not what you want then you will need to be more specific
about what you are trying to achieve.
>
> 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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [SQL] exporting query result
2017-05-12 09:14 exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 13:12 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
@ 2017-05-12 15:58 ` Günce Kaya <guncekaya14@gmail.com>
2017-05-12 16:07 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 16:21 ` Re: exporting query result Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 2 replies; 7+ messages in thread
From: Günce Kaya @ 2017-05-12 15:58 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-admin@postgresql.org; pgsql-sql
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.
Regards,
Gunce Kaya
On Fri, 12 May 2017 at 16:12, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
> On 05/12/2017 02:14 AM, Günce Kaya wrote:
> > Good morning all,
> >
> > I use COPY to exporting query result but I'm curious If there is any way
> > to export query result to a CSV file's different spreadsheets through
> > Pgadmin or server?
>
> You can export to CSV using COPY. For pgAdmin see:
>
>
> https://www.pgadmin.org/docs/pgadmin4/1.x/import_export_data.html?highlight=csv
>
> If this is not what you want then you will need to be more specific
> about what you are trying to achieve.
>
> >
> > Regards
> >
> > --
> > Gunce Kaya
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
--
Gunce Kaya
Linkedin <https://tr.linkedin.com/in/guncekaya; - Twitter
<https://twitter.com/gguncesi; - Blog
<http://www.guncekaya.blogspot.com.tr/;
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [SQL] exporting query result
2017-05-12 09:14 exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 13:12 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 15:58 ` Re: [SQL] exporting query result Günce Kaya <guncekaya14@gmail.com>
@ 2017-05-12 16:07 ` Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 16:20 ` Re: exporting query result Günce Kaya <guncekaya14@gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Adrian Klaver @ 2017-05-12 16:07 UTC (permalink / raw)
To: Günce Kaya <guncekaya14@gmail.com>; pgsql-admin@postgresql.org; pgsql-sql
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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: exporting query result
2017-05-12 09:14 exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 13:12 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 15:58 ` Re: [SQL] exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 16:07 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
@ 2017-05-12 16:20 ` Günce Kaya <guncekaya14@gmail.com>
0 siblings, 0 replies; 7+ messages in thread
From: Günce Kaya @ 2017-05-12 16:20 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-admin@postgresql.org; pgsql-sql
Hi again,
Thank you for your advice. It's more clear now. I'll look at this link.
Regards,
Gunce Kaya
On Fri, 12 May 2017 at 19:07, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
> 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
>
--
Gunce Kaya
Linkedin <https://tr.linkedin.com/in/guncekaya; - Twitter
<https://twitter.com/gguncesi; - Blog
<http://www.guncekaya.blogspot.com.tr/;
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: exporting query result
2017-05-12 09:14 exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 13:12 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 15:58 ` Re: [SQL] exporting query result Günce Kaya <guncekaya14@gmail.com>
@ 2017-05-12 16:21 ` Thomas Kellerer <spam_eater@gmx.net>
2017-05-12 18:03 ` Re: exporting query result Günce Kaya <guncekaya14@gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Thomas Kellerer @ 2017-05-12 16:21 UTC (permalink / raw)
To: pgsql-sql; +Cc: pgsql-admin@postgresql.org
Günce Kaya schrieb am 12.05.2017 um 17:58:
> 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.
A CSV file has no sheets (it does not even have a "structure" as it is plain text).
The tool I am maintaining can do you what you want (or at least what I think you want):
It has a built-in command to export data to various formats including ODS or XLSX which you need in order to create multiple "sheets"
The following command
WbExport -file=data.xlsx -sourceTable=table_one,table_two, table_three;
Creates a single XLSX file with three sheets, one for each table.
You can download it here: http://www.sql-workbench.net/
For details on the WbExport command see here: http://www.sql-workbench.net/manual/command-export.html
Disclosure: I am the author of that tool.
Regards
Thomas
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: exporting query result
2017-05-12 09:14 exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 13:12 ` Re: [SQL] exporting query result Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 15:58 ` Re: [SQL] exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 16:21 ` Re: exporting query result Thomas Kellerer <spam_eater@gmx.net>
@ 2017-05-12 18:03 ` Günce Kaya <guncekaya14@gmail.com>
0 siblings, 0 replies; 7+ messages in thread
From: Günce Kaya @ 2017-05-12 18:03 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql; +Cc: pgsql-admin@postgresql.org
Hi Thomas,
After your mail I figured out that I need export result to excel file. I
used workbench before but I did not know to do it.
Thanks a lot,
Regards.
Gunce
On Fri, 12 May 2017 at 19:21, Thomas Kellerer <spam_eater@gmx.net> wrote:
> Günce Kaya schrieb am 12.05.2017 um 17:58:
> > 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.
>
> A CSV file has no sheets (it does not even have a "structure" as it is
> plain text).
>
> The tool I am maintaining can do you what you want (or at least what I
> think you want):
>
> It has a built-in command to export data to various formats including ODS
> or XLSX which you need in order to create multiple "sheets"
>
> The following command
>
> WbExport -file=data.xlsx -sourceTable=table_one,table_two, table_three;
>
> Creates a single XLSX file with three sheets, one for each table.
>
> You can download it here: http://www.sql-workbench.net/
>
> For details on the WbExport command see here:
> http://www.sql-workbench.net/manual/command-export.html
>
> Disclosure: I am the author of that tool.
>
> Regards
> Thomas
>
>
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>
--
Gunce Kaya
Linkedin <https://tr.linkedin.com/in/guncekaya; - Twitter
<https://twitter.com/gguncesi; - Blog
<http://www.guncekaya.blogspot.com.tr/;
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2017-05-12 18:03 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-12 09:14 exporting query result Günce Kaya <guncekaya14@gmail.com>
2017-05-12 13:12 ` Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 15:58 ` Günce Kaya <guncekaya14@gmail.com>
2017-05-12 16:07 ` Adrian Klaver <adrian.klaver@aklaver.com>
2017-05-12 16:20 ` Günce Kaya <guncekaya14@gmail.com>
2017-05-12 16:21 ` Thomas Kellerer <spam_eater@gmx.net>
2017-05-12 18:03 ` Günce Kaya <guncekaya14@gmail.com>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox