Re: [GENERAL] CVS Import/Export - Mailing list pgsql-general

From Simon Drabble
Subject Re: [GENERAL] CVS Import/Export
Date
Msg-id Pine.LNX.3.96.990818104508.2005A-100000@dragon
Whole thread Raw
In response to CVS Import/Export  (Bruce Tong <zztong@laxmi.ev.net>)
List pgsql-general
On Wed, 18 Aug 1999, Bruce Tong wrote:

> I feel like such a bone-head asking this question, but I didn't find the
> answer in the FAQ or the documentation, other than pgaccess is supposed to
> have some of this functionality...
>
> How do I import/export comma delimited tables?
>
> I thought a combination of pg_dump and psql might do it, but if so I must
> have missed it. I saw a mention of it for pgaccess, but I'm looking for
> something I can put in a shell script.
>
> --
>
> Bruce Tong                 |  Got me an office; I'm there late at night.

If you're after changing the field separator, psql has a \f command.

You could do something like:

$ psql -e <dbname> < out.sql > dump

where out.sql looks like:

\f ,
\o
-- some select statements go here
SELECT foo FROM bar;

-- EOF


A method for importing would be similar.



Simon.
--
 "Don't anthropomorphise computers - they don't like it."

   Simon Drabble                      It's like karma for your brain.
   simon@eskimo.com


pgsql-general by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [GENERAL] CVS Import/Export
Next
From: Herouth Maoz
Date:
Subject: Re: [GENERAL] CVS Import/Export