Re: Error Importing CSV File

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bryan Nelson <shrek(at)shreks-place(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Error Importing CSV File
Date: 2011-07-15 18:16:52
Message-ID: 4586.1310753812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bryan Nelson <shrek(at)shreks-place(dot)com> writes:
> Tom, rake is a rails command, also after doing a \d geo_data it does
> show that it's adding an id column before everything else. I'm
> guessing my best bet is going to be creating the table by hand as I
> have no idea how to tell it not to create the extra field.

No need to abandon your infrastructure; you just have to tell COPY what
columns to expect in the CSV file.

COPY geo_data(zip_code, latitude, longitude, city, state, county) FROM ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2011-07-15 18:19:29 Re: Error Importing CSV File
Previous Message James B. Byrne 2011-07-15 18:13:46 Re: Error Importing CSV File