Re: pg_trgm - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: pg_trgm
Date
Msg-id 20100529.171328.20490849.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: pg_trgm  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: pg_trgm
Re: pg_trgm
List pgsql-hackers
> > It's not a practical solution for people working with prebuilt Postgres
> > versions, which is most people.  I don't object to finding a way to
> > provide a "not-space" behavior instead of an "is-alnum" behavior,
> > but as noted upthread a GUC isn't the right way.  How do you feel
> > about a new set of functions with an additional flag argument of
> > some sort?
> 
> Let me see how many functions we need to create...

After thinking a little bit more, I think following patch would not
break existing behavior and also adopts mutibyte + C locale case. What
do you think?

*** trgm_op.c~    2009-06-11 23:48:51.000000000 +0900
--- trgm_op.c    2010-05-29 17:07:28.000000000 +0900
***************
*** 59,65 **** }  #ifdef KEEPONLYALNUM
! #define iswordchr(c)    (t_isalpha(c) || t_isdigit(c)) #else #define iswordchr(c)    (!t_isspace(c)) #endif
--- 59,67 ---- }  #ifdef KEEPONLYALNUM
! #define iswordchr(c)    (lc_ctype_is_c()? \
!                                 ((*(c) & 0x80)? !t_isspace(c) : (t_isalpha(c) || t_isdigit(c))) : \
!                                 (t_isalpha(c) || t_isdigit(c))) #else #define iswordchr(c)    (!t_isspace(c)) #endif


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Failback with log shipping
Next
From: Jesper Krogh
Date:
Subject: Re: tsvector pg_stats seems quite a bit off.