[MASSMAIL]Obsolete comment in CopyReadLineText() - Mailing list pgsql-hackers

From Tom Lane
Subject [MASSMAIL]Obsolete comment in CopyReadLineText()
Date
Msg-id 1461688.1712347668@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
CopyReadLineText quoth:

     * The objective of this loop is to transfer the entire next input line
     * into line_buf.  Hence, we only care for detecting newlines (\r and/or
     * \n) and the end-of-copy marker (\.).
     *
     * In CSV mode, \r and \n inside a quoted field are just part of the data
     * value and are put in line_buf.  We keep just enough state to know if we
     * are currently in a quoted field or not.
     *
     * These four characters, and the CSV escape and quote characters, are
     * assumed the same in frontend and backend encodings.

When that last bit was written, it was because we were detecting
newlines and end-of-copy markers before performing encoding
conversion.  That's not true any more: by the time CopyReadLineText
sees the data, it was already converted by CopyConvertBuf.  So
I don't believe there actually is any such dependency anymore,
and we should simply remove that last sentence.  Any objections?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: pg_combinebackup --copy-file-range
Next
From: Andrew Dunstan
Date:
Subject: Re: WIP Incremental JSON Parser