Re: Escaped backslash in SQL constant

From: "CN" <cnliou9(at)fastmail(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Escaped backslash in SQL constant
Date: 2005-12-24 05:52:18
Message-ID: 1135403538.24440.250483260@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you again for the clarification!

> I'm not sure how to explain it any more clearly: the backslash in this
> example is not a backslash. It's a byte within a multibyte character,
> which *entirely coincidentally* happens to have the same numeric value
> as an ASCII backslash. But it isn't a backslash. And it won't be
> processed as a backslash by any Big5-aware code.

If I understand this explanation correctly, then you have given me the
answer I needed!
Please correct me if my understanding that follows is wrong again:

PostgreSQL is Big5-aware code. It does not blindly unescape every
backlash it encounters in SQL literals. Instead, it sees backslash as
part of some Big5 characters as they are supposed to be when client
encoding is set to Big5 (SET CLIENT_ENCODING TO BIG5). In other words,
PostgreSQL sees the backslash in "C:\134" differently from that being
part of multi-byte characters depending on which client encoding is
used.

Regards,

CN

--
http://www.fastmail.fm - And now for something completely different

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2005-12-24 06:14:11 Re: query for a time interval
Previous Message Tom Lane 2005-12-24 04:24:43 Re: Escaped backslash in SQL constant