I've discovered the \copy
command to upload CSV/TSV files to a table. It's a very convenient method because I have a large amount of data to load at the same time.
My problem is that I have some text to load and some of them contain \n
characters. Because I generate utf-8 text files, they are recognized as new line characters and can't be properly loaded in the database. Is there a way to encode them, using python function, to create my file to upload ?