Re: Zero-length character breaking query? - Mailing list pgsql-general

From Peter Bex
Subject Re: Zero-length character breaking query?
Date
Msg-id 20120316170442.GA882@frohike.homeunix.org
Whole thread Raw
In response to Zero-length character breaking query?  (Doug Gorley <dgorley@aihs.ca>)
List pgsql-general
On Thu, Mar 15, 2012 at 05:09:32PM -0600, Doug Gorley wrote:
> G'day,
>
> "select * from tdt_unsent where str_name_l = 'SMITH'" returns 0 rows.
> "select * from tdt_unsent where str_name_l ~ '^SMITH'" returns 3 rows.
> "select * from tdt_unsent where str_name_l ~ '^SMITH$'" returns 0 rows.
> "select length(str_name_l) from tdt_unsent where str_name_l ~ '^SMITH'" returns "5".

What does octet_length return?  Perhaps this is some nonprintable
control character.  Unicode is full of those.  If it differs from
the string length, then you can be pretty sure that's the case.

Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                            -- Donald Knuth

pgsql-general by date:

Previous
From: "mike@trausch.us"
Date:
Subject: Re: Windows 7 Compatibility
Next
From: Bryan Montgomery
Date:
Subject: Authenticating from a web service call