How to import from a mixed-encoding file to a PostgreSQL table
问题 I have a 30 GB text file. the encoding of the file is UTF8 but it also contains some Windows-1252 characters. So, when I try to import, it gives the following error: ERROR: invalid byte sequence for encoding "UTF8": 0x9b How can I fix this? the file already has UTF8 format, when i run the 'file' command for this file it says the encoding is UTF8. but it also contains some not UTF8 byte sequences. for example when I run the \copy command after a while it gives the above mentioned error for