| From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> | 
|---|---|
| To: | "David E(dot) Wheeler" <david(at)kineticode(dot)com> | 
| Cc: | Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org | 
| Subject: | Re: Latest on CITEXT 2.0 | 
| Date: | 2008-06-26 16:19:56 | 
| Message-ID: | 20080626161956.GC4396@alvh.no-ip.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
David E. Wheeler wrote:
> The operator functions *do* use PG_FREE_IF_COPY(). So I'm guessing it's 
> these functions you're talking about. However, my implementation just 
> looks like this:
>
> Datum citext_ne (PG_FUNCTION_ARGS) {
>     // Fast path for different-length inputs. Okay for canonical  
> equivalence?
>     if (VARSIZE(PG_GETARG_TEXT_P(0)) != VARSIZE(PG_GETARG_TEXT_P(1)))
>         PG_RETURN_BOOL( 1 );
>     PG_RETURN_BOOL( citextcmp( PG_ARGS ) != 0 );
> }
PG_GETARG_TEXT_P can detoast the datum, which creates a copy.
-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Josh Berkus | 2008-06-26 16:29:44 | Re: [0/4] Proposal of SE-PostgreSQL patches | 
| Previous Message | David E. Wheeler | 2008-06-26 16:02:56 | Re: Latest on CITEXT 2.0 |