|
Home > Archive > PostgreSQL Newbies > July 2005 > invalid input syntax for integer
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
invalid input syntax for integer
|
|
| James Nobles 2005-07-10, 8:23 pm |
| I've just created my first table and I'm trying to load date into it via
the \copy command. Each time i get the invalid input syntax, no matter
what the type for the column is set too. I've tried int,integer and now
numeric.
Column | Type | Modifiers
-------------+-----------------------+-----------
county_code | integer |
cntyname | character varying(30) |
\copy fips_codes_county FROM '/var/lib/pgsql/files/county.csv' USING
DELIMITERS ','
This is a sample of the file i'm attempting to load, a simple ascii/csv
file.
cat county.csv|more
county_code,cntyname
1,ANDERSON
3,ANDREWS
5,ANGELINA
7,ARANSAS
9,ARCHER
11,ARMSTRONG
13,ATASCOSA
15,AUSTIN
17,BAILEY
19,BANDERA
21,BASTROP
23,BAYLOR
25,BEE
27,BELL
29,BEXAR
31,BLANCO
thanks...
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
| |
| Tom Lane 2005-07-10, 8:23 pm |
| James Nobles < james@bolshevikhosti
ng.com> writes:
> This is a sample of the file i'm attempting to load, a simple ascii/csv
> file.
> cat county.csv|more
> county_code,cntyname
^^^^^^^^^^^
Well, that isn't a valid integer, is it?
In PG 8.1 you'll be able to say "CSV HEADER" to make it ignore the first
line of COPY input, but in existing releases I believe there's no
alternative but to remove the header line.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
|
|
|
|
|