1

I am importing a CSV file which is related to the properties. It has /n between the values. While trying to import it into a table, the following error shows up:

PostgreSQL invalid byte sequence for encoding utf8 0xbf

I tried by simply importing the single column only, but it is not working. Column values will look like this:

"Job No 305385917-001: To attached Garage (Single remain).\n10305 - 132 STREET NW
Plan 23AF Blk 84 Lot 14\n2002995 LERTA LTD O/A LIR HOMES DONTON\nHENORA"

I want to import the above whole into a single column.

COPY edmonton.general_filtered (descriptive)
FROM 'D:/property_own/descriptive_details.csv'
DELIMITER ',' CSV HEADER;

1 Answer 1

1

Your COPY statement is correct, but your data are not in UTF8 encoding.

They are probably in Latin-1 or Windows-1252, where 0xBF is ¿.

Specify the encoding correctly, e.g.:

COPY edmonton.general_filtered (descriptive)
FROM 'D:/property_own/descriptive_details.csv'
(FORMAT 'csv', HEADER, ENCODING 'WIN1252');
Sign up to request clarification or add additional context in comments.

1 Comment

@Agnyvel your best option is to download a program (like Notepad++) where you can check the encoding of a text file.. Before using this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.