Re: Exporting data from PostgreSQL - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: Exporting data from PostgreSQL
Date
Msg-id 58586F66-9D95-11D7-B593-0005029FC1A7@myrealbox.com
Whole thread Raw
In response to Re: Exporting data from PostgreSQL  ("paul butler" <paul@entropia.co.uk>)
Responses Re: Exporting data from PostgreSQL
List pgsql-novice
On Friday, Jun 13, 2003, at 16:38 Asia/Tokyo, paul butler wrote:
> Go into psql
>
> mfx=# \pset fieldsep '\t'       // sets field delimiter to tab
> Field separator is '    '.
> mfx=# select * from actor;     // make your query
> mfx=# \o d:\A\tester.txt       // set file to output results
> mfx=# select * from actor;    // execute query

Thanks, Paul! That is exactly what I was looking for. I was able to
make a file! :)
Though, for some reason still unknown to me, it wasn't tab-delimited,
even though I entered the commands above and I got back the "Field
separator is '  '." line. It came out the standard pipes and dashes,
though that's easily cleaned up in BBEdit. I'll do a bit more reading
about psql and see if I can't work it out.

One question. Is there a reason why the query is included twice, once
before and once after the \o line? I tried it omitting the first query
and the results seemed just fine.

Thanks again for your help, Paul!

Michael Glaesemann
grzm myrealbox com


pgsql-novice by date:

Previous
From: "Marcus Andree S. Magalhaes"
Date:
Subject: number of rows
Next
From: Alan Searles
Date:
Subject: Re: Converting IBM DB2 TRIGGERs to PostgreSQL