Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rspqq-009a4B-TC for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2024 20:07:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rspqp-004xIa-UP for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2024 20:07:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rspqp-004xIP-KS for pgsql-hackers@lists.postgresql.org; Fri, 05 Apr 2024 20:07:51 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rspqn-000nmp-7J for pgsql-hackers@lists.postgresql.org; Fri, 05 Apr 2024 20:07:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 435K7mPn1461689 for ; Fri, 5 Apr 2024 16:07:48 -0400 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: Obsolete comment in CopyReadLineText() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1461687.1712347668.1@sss.pgh.pa.us> Date: Fri, 05 Apr 2024 16:07:48 -0400 Message-ID: <1461688.1712347668@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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