|
|
|
|
|
by seanhunter
617 days ago
|
|
Most of these issues while real don't actually arise in this case, because we're not trying to ETL some random file, we are the ones talking to the database so we get to choose exactly how the data gets formatted on extract. For example, here's your list fully handled in postgres:
1. SET CLIENT_ENCODING TO 'value'; (eg 'UTF8')
2. COPY ... with FORMAT CSV DELIMITER 'delimiter_character' QUOTE 'quote_character' Now the output format is fully specified and everything just works fine (including for input into excel) The values in each record are separated by the DELIMITER character. If the value contains the delimiter character, the QUOTE character, the NULL string, a carriage return, or line feed character, then the whole value is prefixed and suffixed by the QUOTE character, and any occurrence within the value of a QUOTE character or the ESCAPE character is preceded by the escape character.
https://www.postgresql.org/docs/current/sql-copy.html |
|