Re: Latest on CITEXT 2.0 - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Latest on CITEXT 2.0
Date
Msg-id 5F9B80BA-0389-4B64-B402-E0AB8863EC0C@kineticode.com
Whole thread Raw
In response to Re: Latest on CITEXT 2.0  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
On Jun 26, 2008, at 03:28, Martijn van Oosterhout wrote:

> Hmm, casts to/from text are somewhat "magic" in postgres. They are
> implemented by calling the usual type input/output function. I have no
> idea how to extend that to other types.

Oh. Okay. Perhaps I won't worry about it just now, then.

> As above, they're probably not as seperate functions but a special  
> hack
> inthe casting code.

Okay.

> Regexes have case-insensetive modifiers, don't they? In which case I
> don't think it'd be becessary.

They do, but replace(), split_part(), strpos(), and translate() do not.

> When creating an index, your comparison functions are going ot be
> called O(N log N) times. If they leak into a context that isn't
> regularly freed you may have a problem. I'd suggest loking at how the
> text comparisons do it. PG_FREE_IF_COPY() is probably a good idea
> because the incoming tuples may be detoasted.

Okay. I'll have a look at varlena.c, then.

>> * Am I in fact getting an appropriate nul-terminated string in my
>> cilower() function using this code?
>>
>>    char * str  = DatumGetCString(
>>        DirectFunctionCall1( textout, PointerGetDatum( arg ) )
>>    );
>
> Yes.

Great, I thought so (since it made the failures go away). Many thanks.

David



pgsql-hackers by date:

Previous
From: KaiGai Kohei
Date:
Subject: Re: Proposal of SE-PostgreSQL patches [try#2]
Next
From: KaiGai Kohei
Date:
Subject: Re: [0/4] Proposal of SE-PostgreSQL patches