Re: Escaped backslash in SQL constant - Mailing list pgsql-general

From CN
Subject Re: Escaped backslash in SQL constant
Date
Msg-id 1135403538.24440.250483260@webmail.messagingengine.com
Whole thread Raw
In response to Re: Escaped backslash in SQL constant  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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�


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Escaped backslash in SQL constant
Next
From: Bruno Wolff III
Date:
Subject: Re: query for a time interval