On Tue, Jun 13, 2006 at 09:14:48AM -0700, Joshua D. Drake wrote:
> >I don't get it. If you can use psql then you already have csv support.
> >
> >psql -c 'COPY pg_class TO STDOUT WITH CSV' postgres > pg_class.csv
> 
> If you data looks like this:
> 
> foo   barbaz  bing
> 
> You are o.k. You have three columns, tab delimited.
> 
> However if you data looks like this:
> 
> foo   bar     baz     bing
> 
> You have a problem.

I'm not exactly sure what you're getting at here:

postgres=# create temp table x (a text, b text, c text);
CREATE TABLE
postgres=# insert into x values ('"blah"', 'hello       world', 'hmmm
postgres'# ');
INSERT 0 1
postgres=# \copy x to stdout csv
"""blah""",hello        world,"hmmm
"

> An alternative although I don't know what kind of headaches it would 
> cause is to have a text delimiter as well as a field delimter, e.g;

Postgresql already delimits CSV fields as required, so I'm not sure what
you're asking here...

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.

Attachment: signature.asc
Description: Digital signature

Reply via email to