Re: CSV delim quoting differences PgCOPY, Excel etc... - Mailing list pgsql-general

From Edmund Bacon
Subject Re: CSV delim quoting differences PgCOPY, Excel etc...
Date
Msg-id m3sm0la9yx.fsf@elb-lx.onesystem.ca
Whole thread Raw
In response to CSV delim quoting differences PgCOPY, Excel etc...  (Jerry Sievers <jerry@jerrysievers.com>)
List pgsql-general
jerry@jerrysievers.com (Jerry Sievers) writes:

> Hello.
>
> Anyway, I am often enough having to load Pg databases using SQL COPY
> from CSV output written by Excel, that I've had to write a script to
> change the quoting behavior from Excel's putting double quotes around
> a field having embedded delim chars, to Pg's backslash quoting.
>
> I've got a hunch that one or both of the aforementioned softwares can
> change their quoting behavior.  (IT just seems reasonable... famous
> last words.)
>
> Is it true that neither of Pg SQL \copy and/or Excel can adapt as I
> wish?  What about psql \copy?  I fail to read in the docs for the Pg
> products any support for this.
>
> If Excel can adapt, at least one experienced user I've asked, doesn't
> know about it.
>
> Thanks.
>
As of version 8.0 Pg has been taught how to "do the right thing" to
copy CSV files:

COPY mytable TO 'myfile' WITH CSV;


--
Remove -42 for email

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: [JDBC] Storing/Using Passwords
Next
From: "Jan Sunavec"
Date:
Subject: Count and Results together