Re: PATCH: CITEXT 2.0 v4 - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: PATCH: CITEXT 2.0 v4
Date
Msg-id 80B7A7E8-CABD-4663-B13E-2B39324F89CD@kineticode.com
Whole thread Raw
In response to Re: PATCH: CITEXT 2.0 v4  (Michael Paesold <mpaesold@gmx.at>)
Responses Re: PATCH: CITEXT 2.0 v4
List pgsql-hackers
On Jul 17, 2008, at 03:45, Michael Paesold wrote:

> Wouldn't it be possible to create a variant of regexp_replace, i.e.  
> regexp_replace(citext,citext,text), which would again lower-case the  
> first two arguments before passing the input to  
> regexp_replace(text,text,text)?

Sure, but then you end up with this:

template1=# select regexp_replace( 'Fxx'::citext, 'X'::citext, 'o');
regexp_replace
----------------
foo
(1 row)

Which is just wrong. I'm going to look at the regex C functions today  
and see if there's an easy way to just always pass them the 'i' flag,  
which would do the trick. That still won't help replace(),  
split_part(), or translate(), however.

Best,

David


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH]-hash index improving
Next
From: Alvaro Herrera
Date:
Subject: Re: autovacuum crash due to null pointer