Re: convert text file to database - Mailing list pgsql-novice

From Tom Lane
Subject Re: convert text file to database
Date
Msg-id 9788.1208530192@sss.pgh.pa.us
Whole thread Raw
In response to convert text file to database  (e-letter <inpost@gmail.com>)
List pgsql-novice
e-letter <inpost@gmail.com> writes:
> I tried to import the csv file using the command:

> chessmatches=# COPY chessgames FROM '/absolute/path/filename.csv';
> ERROR:  invalid input syntax for integer: "Event..."

Umm ... you didn't tell it the data is in CSV.  I think you need at
least the HEADER option too.  See the COPY manual page:
http://www.postgresql.org/docs/8.3/static/sql-copy.html

            regards, tom lane

pgsql-novice by date:

Previous
From: e-letter
Date:
Subject: convert text file to database
Next
From: "Andrej Ricnik-Bay"
Date:
Subject: Re: Remote / network connection fails