Help with exporting data

From: Brent Wood <b(dot)wood(at)niwa(dot)co(dot)nz>
To: Aleksei Wolff <aleksei_wolff(at)yahoo(dot)com>, Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: Help with exporting data
Date: 2003-02-28 02:39:30
Message-ID: 20030228153157.K75041-100000@storm.niwa.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have an application which is using Postgres to store/manage it's data.

I'd like to be able to export (to text files) the outputs from queries.

There are two ways I've found I can do this.

I can run a select from a shell & redirect the output to a file, then
reformat the file to plain whitespace delimited values.

I can create a new (possibly temp) table with select into & copy the
resulting table to a file. I can't see any other way in the docs, as copy
won't work with views.

Is there a simpler (& more efficient) way to get the result of a select
into a plain text file, without the Postgres header/trailer lines & the
"|" between attributes?

Thanks,

Brent Wood

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2003-02-28 02:46:08 Re: Help! I don't get mail anymore
Previous Message Stephan Szabo 2003-02-28 01:17:24 Re: use of %TYPE