angusdev commented on PR #265:
URL: https://github.com/apache/commons-csv/pull/265#issuecomment-1258667702

   Added test for tab characters (ASCII 9) in values.
   
   For QUOTE and ESCAPE, see below example
   
   ```
   postgres=# insert into COMMONS_CSV_PSQL_TEST select 1, '"quoted"', 
'|quoted2|', null, null;
   INSERT 0 1
   postgres=# copy COMMONS_CSV_PSQL_TEST to STDOUT with CSV;
   1,"""quoted""",|quoted2|,,
   postgres=# copy COMMONS_CSV_PSQL_TEST to STDOUT with CSV QUOTE '|';;
   1,"quoted",|||quoted2|||,,
   postgres=# copy COMMONS_CSV_PSQL_TEST to STDOUT with CSV ESCAPE '~';
   1,"~"quoted~"",|quoted2|,,
   postgres=# copy COMMONS_CSV_PSQL_TEST to STDOUT with CSV QUOTE '|' ESCAPE 
'~';
   1,"quoted",|~|quoted2~||,,
   postgres=# copy COMMONS_CSV_PSQL_TEST to STDOUT QUOTE '|';
   ERROR:  COPY quote available only in CSV mode
   postgres=# copy COMMONS_CSV_PSQL_TEST to STDOUT ESCAPE '~';
   ERROR:  COPY escape available only in CSV mode
   ```
   
   In PG (CSV), ESCAPE is used to escape the quote char, while in COMMONS_CSV, 
ESCAPE is to escape delimiter and special char
   
   In PG (TEXT), QUOTE is not needed as it is tab-delimited and the delimiter 
(tab) is escaped by '\t'
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to