Re: Latest on CITEXT 2.0
От | Alvaro Herrera |
---|---|
Тема | Re: Latest on CITEXT 2.0 |
Дата | |
Msg-id | 20080626161956.GC4396@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: Latest on CITEXT 2.0 ("David E. Wheeler" <david@kineticode.com>) |
Ответы |
Re: Latest on CITEXT 2.0
|
Список | 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.
В списке pgsql-hackers по дате отправления: