Re: Expected behaviour of \d in regexp with exponent numbers ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Expected behaviour of \d in regexp with exponent numbers ?
Дата
Msg-id 26124.1409587918@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Expected behaviour of \d in regexp with exponent numbers ?  (Arnaud Lesauvage <arnaud.listes@codata.eu>)
Ответы Re: Expected behaviour of \d in regexp with exponent numbers ?  (Arnaud Lesauvage <arnaud.listes@codata.eu>)
Re: Expected behaviour of \d in regexp with exponent numbers ?  (Vick Khera <vivek@khera.org>)
Список pgsql-general
Arnaud Lesauvage <arnaud.listes@codata.eu> writes:
> Le 1/09/2014 17:39, Tom Lane a �crit :
>> Not necessarily.  \d will match any character that iswdigit() returns true
>> for.  It looks like your new server is using a locale that considers "�"
>> to be a digit.

> Since both PostgreSQL servers run on the same computer, can I assume
> that this is a collation problem ?

Ah: after consulting the commit history I realized that the regex
operators only base \d on iswdigit() in 9.2 and later.  Before that
it was hardwired as [0-9].  So there might not be any difference
in the locale environment after all.

I wonder whether this was a bad idea.  I think it's unsurprising for the
definition of "alphanumeric" to depend on locale, but I bet most people
are not expecting \d to vary that way.

            regards, tom lane


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

Предыдущее
От: Arnaud Lesauvage
Дата:
Сообщение: Re: Expected behaviour of \d in regexp with exponent numbers ?
Следующее
От: David G Johnston
Дата:
Сообщение: Re: copymanager question