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)
Список
Дерево обсуждения
Zero-length character breaking query? Doug Gorley <dgorley@aihs.ca>
Re: Zero-length character breaking query? Peter Bex <Peter.Bex@xs4all.nl>
Re: Zero-length character breaking query? Bosco Rama <postgres@boscorama.com>
Re: Zero-length character breaking query? Tom Lane <tgl@sss.pgh.pa.us>
Re: Zero-length character breaking query? Doug Gorley <dgorley@aihs.ca>
Re: Zero-length character breaking query? David Johnston <polobo@yahoo.com>
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 по дате отправления