Re: Table to Excel

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Josh Trutwin <josh(at)trutwins(dot)homeip(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Table to Excel
Date: 2009-03-26 16:30:44
Message-ID: 162867790903260930j6d5b256fs298a8c767cf4a92@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

2009/3/26 Josh Trutwin <josh(at)trutwins(dot)homeip(dot)net>:
> On Thu, 26 Mar 2009 08:04:25 +0100
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>
>> hello
>>
>> use csv format - excel have to read this format without any format
>>
>> COPY tablename TO '...' CSV;
>
> Another possibility that I use often is to set the output to HTML
> mode using:
>
> \H
>
> Then set to send query results to a file:
>
> \o myresults.html
>
> Then run a single query:
>
> SELECT col1, col2 FROM foo WHERE bar = '1' ORDER BY baz;
>
> \q
>
> Now you can open your .html file directly into Excel since it's just
> a big html table.
>

It is true, so you can use html, but html has significant overhead -
CVS is really simple format - designed for this case.

Pavel

> Josh
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Midgley 2009-03-26 16:38:58 Re: Can we load all database objects in memory?
Previous Message Josh Trutwin 2009-03-26 14:05:12 Re: Table to Excel