Re: Zero-length character breaking query?

Поиск
Список
Период
Сортировка
От Peter Bex
Тема Re: Zero-length character breaking query?
Дата
Msg-id 20120316170442.GA882@frohike.homeunix.org
обсуждение исходный текст
Ответ на Zero-length character breaking query?  (Doug Gorley <dgorley@aihs.ca>)
Список 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 по дате отправления:

Предыдущее
От: "mike@trausch.us"
Дата:
Сообщение: Re: Windows 7 Compatibility
Следующее
От: Bryan Montgomery
Дата:
Сообщение: Authenticating from a web service call