Zero-length character breaking query?

Поиск
Список
Период
Сортировка
От Doug Gorley
Тема Zero-length character breaking query?
Дата
Msg-id 571E120A87CC684288FDD20126E4B4D674DE93CA47@HEXMBVS13.hostedmsx.local
обсуждение исходный текст
Ответы Re: Zero-length character breaking query?  (David Johnston <polobo@yahoo.com>)
Re: Zero-length character breaking query?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Zero-length character breaking query?  (Peter Bex <Peter.Bex@xs4all.nl>)
Re: Zero-length character breaking query?  (Bosco Rama <postgres@boscorama.com>)
Список pgsql-general
G'day,

I believe I've got some bad data in a table, but I'm not sure how it got there, or how this scenario is possible.

The table is called tdt_unsent.  The field is str_name_l.  For demonstration purposes,  the value is "SMITH".

"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".

So, it's as if there is a zero-length character at the end of the value that is preventing a match.  Is this possible?
Ifso, how could this data have been created? 

Thanks,

Doug Gorley
dgorley@aihs.ca


В списке pgsql-general по дате отправления:

Предыдущее
От: Dmytrii Nagirniak
Дата:
Сообщение: Re: Optimise PostgreSQL for fast testing
Следующее
От: Greg Williamson
Дата:
Сообщение: Re: A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?