Search Postgresql Archives

Can't get a simple COPY to work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux