Re: pg_trgm

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: pg_trgm
Дата
Msg-id 20100527.233907.28787479.t-ishii@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: pg_trgm  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_trgm  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Well, that doesn't mean that the answer is to use C locale ;-)

Of course it's up to user whether to use C locale or not. I just want
pg_trgm work with C locale as well.

> However, you could possibly think about making this bit of code
> more flexible:
> 
> #ifdef KEEPONLYALNUM
> #define iswordchr(c)    (t_isalpha(c) || t_isdigit(c))
> #else
> #define iswordchr(c)    (!t_isspace(c))
> #endif
> 
> Currently it seems to be hard-wired to the first case in standard
> builds.

Yup. Here is the patch in my mind:

*** trgm_op.c~    2009-06-11 23:48:51.000000000 +0900
--- trgm_op.c    2010-05-27 23:38:20.000000000 +0900
***************
*** 59,65 **** }  #ifdef KEEPONLYALNUM
! #define iswordchr(c)    (t_isalpha(c) || t_isdigit(c)) #else #define iswordchr(c)    (!t_isspace(c)) #endif
--- 59,65 ---- }  #ifdef KEEPONLYALNUM
! #define iswordchr(c)    (t_isalpha(c) || t_isdigit(c) || (lc_ctype_is_c() && !t_isspace(c))) #else #define
iswordchr(c)   (!t_isspace(c)) #endif
 


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_trgm
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_trgm