Can't get a simple COPY to work

From: runner <runner(at)winning(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Can't get a simple COPY to work
Date: 2011-03-16 21:36:25
Message-ID: 8CDB2395637DDAF-1380-CD7F@web-mmc-d05.sysops.aol.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm getting really frustrated, I can't get a simple COPY command to work. I've tried running psql and both the postgres user and the owner of the database with the same error.

psql -U postgres -d database1

database1=# BEGIN;
BEGIN
database1=# TRUNCATE TABLE grades;
TRUNCATE TABLE
database1=# COPY grades FROM grades_csv_file;
ERROR: syntax error at or near grades_csv_file

It won't let me enter the full path to the csv file and if I run psql from the directory where the csv file is located, it stilll won't accept the name of the csv file. So how do you specify the name of the csv file?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2011-03-16 21:40:05 Re: query taking much longer since Postgres 8.4 upgrade
Previous Message Pavel Stehule 2011-03-16 21:31:12 Re: query taking much longer since Postgres 8.4 upgrade