I use postgres 8.4 and currently trying to import a trivial CSV:
Here is a table:
CREATE TABLE public.sample (
a VARCHAR,
b VARCHAR
) WITHOUT OI
Clearly you have a CSV file while you try to import it as text format. Use:
COPY sample FROM '/tmp/sample.csv' FORMAT CSV;
The default delimiter for CSV format is the comma (,
) anyway. More in the manual. Syntax is for current version 9.1. For PostgreSQL 8.4:
COPY sample FROM '/tmp/sample.csv' CSV;