Re: [SQL] Table to Excel

2009-03-26 Thread Pavel Stehule
hello

use csv format - excel have to read this format without any format

COPY tablename TO '...' CSV;

regards
Pavel Stehule

2009/3/26 Nicholas I :
> Hi ,
>
>  Does any one how to convert table to excel.
>
>  I just tried the COPY table_name to '/home/user/output.xls' using
> delimiters ',';
>
> but the out put of the table that is the column in a table are tab separted,
> all were merged in a single cell.
>
> -Nicholas I
>

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Table to Excel

2009-03-26 Thread Josh Trutwin
On Thu, 26 Mar 2009 08:04:25 +0100
Pavel Stehule  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.

Josh

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Table to Excel

2009-03-26 Thread Pavel Stehule
2009/3/26 Josh Trutwin :
> On Thu, 26 Mar 2009 08:04:25 +0100
> Pavel Stehule  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 ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Can we load all database objects in memory?

2009-03-26 Thread Steve Midgley

At 09:20 AM 3/26/2009, [email protected] wrote:

Message-Id: <[email protected]>
From: ries van Twisk 
To: DM 
In-Reply-To: 


Subject: Re: Can we load all database objects in memory?
Date: Wed, 25 Mar 2009 15:07:21 -0500
References: 


X-Archive-Number: 200903/89
X-Sequence-Number: 32332

The short answer is no, you cannot force PostgreSQL to load all
objects into memory.

However when you proper configure PostgreSQL most, if not all of 
your

data will be cached
by the OS and/or PostgreSQL shared memory system.

On Mar 25, 2009, at 2:20 PM, DM wrote:


I have a database of 10GB.
My Database Server has a RAM of 16GB

Is there a way that I can load all the database objects to memory?
Since you have such an abundance of RAM, I'd think you could simulate 
this feature by setting up some kind of psql script to pull down all 
10gb of data through Postgres when the server first boots - possibly 
just a bunch of "select * from [table];" commands for each table in 
your catalog. All/most of the data should be cached into RAM by the OS 
at that point.


Also, I don't know what the state of the art is regarding RAM disks 
these days, but for a read-only database, that seems like an option 
(10gb of ram disk for your read-only data and 6 gb of ram for OS and 
Pg).


Steve


--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql