Re: CopyReadLineText optimization

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: CopyReadLineText optimization
Date: 2008-03-06 19:38:36
Message-ID: 47D0483C.50606@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-03-06 19:44:31 Re: CopyReadLineText optimization
Previous Message Andrew Dunstan 2008-03-06 19:29:24 Re: CopyReadLineText optimization

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2008-03-06 19:44:31 Re: CopyReadLineText optimization
Previous Message Andrew Dunstan 2008-03-06 19:29:24 Re: CopyReadLineText optimization