Skip site navigation (1) Skip section navigation (2)

Re: request for help with COPY syntax

From: "Chuck D(dot)" <pgsql-list(at)nullmx(dot)com>
To: Adrian Klaver <aklaver(at)comcast(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: request for help with COPY syntax
Date: 2007-10-24 06:59:04
Message-ID: 200710240059.04348.pgsql-list@nullmx.com (view raw or flat)
Thread:
Lists: pgsql-sql
On October 23, 2007 08:51:18 pm you wrote:
>
> I got it to work with your sample data by using the COPY command as
> follows: COPY geo.orig_city_maxmind
> 	FROM '/home/www/geo/DATA/MAXMIND.com/cities_no_header.txt'
> 	CSV quote as '''';


I see what you are after and you solved the syntax problem I was having, but 
now I get the same error on a different line:

ad,l'aldosa,L'Aldosa,02,42.5833333,1.6333333

I guess it considers that line quoted now.  In other words, some lines may 
have both single and double quotes involved, like this:

kz,otdeleniye imeni dvadtsat' vtorogo parts"yezda,Otdeleniye Imeni Dvadtsat' 
Vtorogo Parts"yezda,10,41.47,69.1280556

Is there any way to tell Postgresql that a CSV file has no quotes around each 
field, and that each field may have single or double quotes or both?

In response to

Responses

pgsql-sql by date

Next:From: Chuck D.Date: 2007-10-24 07:02:19
Subject: Re: request for help with COPY syntax
Previous:From: D'Arcy J.M. CainDate: 2007-10-24 05:27:05
Subject: Re: Quick question re foreign keys.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group