Re: pg_trgm

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: ishii(at)postgresql(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, peter_e(at)gmx(dot)net, ishii(at)sraoss(dot)co(dot)jp, andres(at)anarazel(dot)de, pgsql-hackers(at)postgresql(dot)org, teodor(at)sigaev(dot)ru
Subject: Re: pg_trgm
Date: 2010-05-29 08:13:28
Message-ID: 20100529.171328.20490849.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Krogh 2010-05-29 10:34:43 Re: tsvector pg_stats seems quite a bit off.
Previous Message Fujii Masao 2010-05-29 03:11:59 Re: Failback with log shipping