Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group