Re: convert text file to database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: e-letter <inpost(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: convert text file to database
Date: 2008-04-18 14:49:52
Message-ID: 9788.1208530192@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

e-letter <inpost(at)gmail(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andrej Ricnik-Bay 2008-04-18 19:56:49 Re: Remote / network connection fails
Previous Message e-letter 2008-04-18 13:29:14 convert text file to database