August 7th, 2013, 12:10 PM
Relation "tablename" does not exist
I have created a table in Excel, saved it as .csv (comma delimited), and have moved that file over to my Ubuntu server that I am using to run PostgreSQL. I have tried running:
COPY "example" FROM '/home/username/example.csv' WITH DELIMITER ',';
and I always receive an error message saying:
ERROR: relation "example" does not exist
I read that it may be due to the permissions on the .csv file since it was not created by this user account (or even on this computer), and I have changed the permissions to read and write for all users. It still gives the error, so maybe I misunderstood the suggestion I read or maybe I am having a different problem. Any guidance would be appreciated.
August 7th, 2013, 12:27 PM
I could hardly think of a clearer error message.
PostgreSQL is telling you that the table (aka relation) example you're trying to copy your data to doesn't exist. In other words, you need to create it before you can fill it with data.