Re: BUG #6314: The like command does not handle a long string of special chars

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: BUG #6314: The like command does not handle a long string of special chars
Дата
Msg-id 4ED76D7F0200002500043704@gw.wicourts.gov
обсуждение исходный текст
Ответ на BUG #6314: The like command does not handle a long string of special chars  (d.rericha@healthcareoss.com)
Список pgsql-bugs
<d.rericha@healthcareoss.com> wrote:

> Simply set a varchar field in your db to the following string:
> !"#$%'()*+,-/:;=?@[\]^_`{|}~0000&<>

Do you have standard_conforming_strings = on?

> The like command works fine up with escapes up to:
> !"#$%''()*+,-/:;=?@[%
> Notice, I added the % to the end. However, if you go any further -
> no matches:
> !"#$%''()*+,-/:;=?@[\\%
> Strangely, this works and shouldn't:
> !"#$%''()*+,-/:;=?@[\%

It is always better to include a self-contained test case.  For
example:

test=# set standard_conforming_strings = on;
SET
test=# create table t (v text not null);
CREATE TABLE
test=# insert into t values
('!"#$%'()*+,-/:;=?@[\]^_`{|}~0000&<>');
INSERT 0 1
test=# select * from t where v like
'!"#$\%'()*+,-/:;=?@[\\]^_`{|}~0000&<>%'
escape '\';
                           v
--------------------------------------------------------
 !"#$%'()*+,-/:;=?@[\]^_`{|}~0000&<>
(1 row)

So this is not a bug on HEAD.  What do you get when you run it?

-Kevin

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 9.1.1 hot standby startup gets sigbus
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6314: The like command does not handle a long string of special chars