Re: BUG #15069: group by after regexp_replace

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: BUG #15069: group by after regexp_replace
Дата
Msg-id 87fu62qngv.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на BUG #15069: group by after regexp_replace  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:

 PG>     select upper(regexp_replace(a, '\\s+', '')) as keyword

This regexp doesn't do what you seem to be expecting. With
standard_conforming_strings enabled, which is the default, \ is not a
special character to the string literal parser, so the regexp engine is
seeing a regexp of \\s+ which means "match the literal character \
followed by one or more lowercase "s" characters". Accordingly the
regexp never matches on your input.

To remove whitespace use '\s+' or E'\\s+' or '[[:space:]]+'

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #15069: group by after regexp_replace
Следующее
От: Dan Goodliffe
Дата:
Сообщение: Re: BUG #15063: Updates to temporary tables fail when there is apublication with FOR ALL TABLES