public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: [email protected]
Subject: Obsolete comment in CopyReadLineText()
Date: Fri, 05 Apr 2024 16:07:48 -0400
Message-ID: <[email protected]> (raw)

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






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Obsolete comment in CopyReadLineText()
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox