I have a file like (CSV file):
value1|value2|value2....
value1|value2|value2....
value1|value2|value2....
value1|value2|value2....
and would like to load these data into a postgresql table.
The slightly modified version of COPY
below worked better for me, where I specify the CSV
format. This format treats backslash characters in text without any fuss. The default format is the somewhat quirky TEXT
.
COPY myTable FROM '/path/to/file/on/server' ( FORMAT CSV, DELIMITER('|') );