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