Re: CopyReadLineText optimization - Mailing list pgsql-patches

From Heikki Linnakangas
Subject Re: CopyReadLineText optimization
Date
Msg-id 47D0483C.50606@enterprisedb.com
Whole thread Raw
In response to Re: CopyReadLineText optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> BTW, I notice that the code allows CSV escape and quote characters that
> have the high bit set (in single-byte server encodings that is).  Is
> this a good idea?  It seems like such are extremely unlikely to be the
> same in two different encodings.  Maybe we should restrict to the ASCII
> range?  Especially if the client encoding is multibyte ...

At least many of the ISO-8859-* encodings have many common non-ascii
characters, and there's no problem if the client_ and server_encodings
match. But it does seem risky to allow it if we can't detect and throw
an error on the non-safe cases. Perhaps we could translate the chars
from client to server encoding?

If the client encoding is a multibyte one, then we certainly should
elog(ERROR) if you try to do that.

Though from a practical point of view, I doubt anyone would mind if we
just always restricted them to ASCII range...

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: CopyReadLineText optimization
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: CopyReadLineText optimization