You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Jurrie Overgoor (JIRA)" <ji...@apache.org> on 2018/10/22 06:50:00 UTC

[jira] [Commented] (CSV-208) Fix escape character for POSTGRESQL_TEXT and POSTGRESQL_CSV formats.

    [ https://issues.apache.org/jira/browse/CSV-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16658661#comment-16658661 ] 

Jurrie Overgoor commented on CSV-208:
-------------------------------------

Hi [~garydgregory],

You asked me to verify what was in master. When I confirmed that all was ok, I meant that the changes in [PR#32|https://github.com/apache/commons-csv/pull/32] were correctly copied to master. I did not mean that this issue is fixed now.

The issue that my PR addresses is the inconsistencies between Commons-csv's POSTGRESQL_TEXT and POSTGRESQL_CSV formats and PostgreSQL itself. Those inconstencies are now fixed.

The CSV-208 issue is on having the QUOTE and the ESCAPE character the same. Commons-csv can not parse such CSV files; it spits out a stacktrace [as posted above|https://issues.apache.org/jira/browse/CSV-208?focusedCommentId=16307804&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16307804]. So this issue should remain open.

> Fix escape character for POSTGRESQL_TEXT and POSTGRESQL_CSV formats.
> --------------------------------------------------------------------
>
>                 Key: CSV-208
>                 URL: https://issues.apache.org/jira/browse/CSV-208
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>            Priority: Major
>             Fix For: 1.7
>
>         Attachments: CSVFormatTest.java
>
>
> Cannot parse PostgreSQL CSV and Text formats.
> We cannot seem to parse the stock PostgreSQL Text format, see 
> - org.apache.commons.csv.CSVPrinterTest.testRandomPostgreSqlCsv()
> - org.apache.commons.csv.CSVPrinterTest.testRandomPostgreSqlText()
> - org.apache.commons.csv.CSVPrinterTest.testPostgreSqlCsvNullOutput()
> - org.apache.commons.csv.CSVPrinterTest.testPostgreSqlCsvTextOutput()
> I am guessing that the issue is that in PostgreSQL, the escape character is the same as the quote character:
> {quote}
> QUOTE
> Specifies the quoting character to be used when a data value is quoted. The default is double-quote. This must be a single one-byte character. This option is allowed only when using CSV format.
> ESCAPE
> Specifies the character that should appear before a data character that matches the QUOTE value. The default is the same as the QUOTE value (so that the quoting character is doubled if it appears in the data). This must be a single one-byte character. This option is allowed only when using CSV format.
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)