Search Postgresql Archives

Re: \copy command error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>De : pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] De la part de Andrew Maracini
>Envoyé : 3 août 2009 11:46
>À : pgsql-general@xxxxxxxxxxxxxx
>Objet : \copy command error

> 

>hi,
>
>I can't seem to get the \copy command to work.
>
>Here's my syntax:
>
>GISCI# \copy gisp from 'd:/projects/gisp/gisp.csv' delimiter ','
>
>ERROR extra data after last expected column Line 1
>
>
>It is taking all of the fields and grouping them into one field, the .csv has about 4700 records, here is what the first two look like:
>Jon,JF,Doe,GIS Coordinator,Miami University,Ohio,Oxford,OH,United States,10/25/02
>Janet,,Doe,PhD Student and Professional Geologist,York University,Toronto,ON,Canada,9/25/07
>The table has 9 fields mostly varchar and one date field.
>I'm running 8.3 on Windows Vista Ultimate
>
>thanks.
>
>
Andy

Hi Andy,

Your CSV lines have 10 fields (10 comma separated values). Probably, in the data you are exporting, the City/State is one field, but the comma is being exported, thus giving you 10 fields. If this is the case, exporting the City/state field wrapped in quotation marks should do the truck, or use a different delimiter, like Tab

Mark


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux