Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-208

Fix escape character for POSTGRESQL_TEXT and POSTGRESQL_CSV formats.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.7
    • Parser
    • None

    Description

      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
      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.

      Attachments

        1. CSVFormatTest.java
          0.9 kB
          Thomas Richter

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              ggregory Gary D. Gregory
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m