On Aug 24, 2006, at 12:58 , Andrew J. Kopciuch wrote:
On Thursday 24 August 2006 10:34, Stefan Kaltenbrunner wrote:
We just had a complaint on IRC that:
devel=# select 'blah foo bar'::tsvector = 'blah foo bar'::tsvector;
This could be an endianess issue?
This was probably the same person who posted this on the OpenFTS list.
He's compiled from source :
dew=# select version();
PostgreSQL 8.1.4 on powerpc-apple-darwin8.6.0, compiled by GCC
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc.
I don't have any access to an OSX box to verify things ATM. I am
get access to one though. :S Can someone else verify this right
Stefan said he reproduced on OpenBSD/i386 so it is unlikely to be an
endianness issue. Anyway, here's the comparison code- I guess it
doesn't use strcmp to avoid encoding silliness. (?)
silly_cmp_tsvector(const tsvector * a, const tsvector * b)
if (a->len < b->len)
else if (a->len > b->len)
else if (a->size < b->size)
else if (a->size > b->size)
unsigned char *aptr = (unsigned char *) (a->data) +
unsigned char *bptr = (unsigned char *) (b->data) +
while (aptr - ((unsigned char *) (a->data)) < a->len)
if (*aptr != *bptr)
return (*aptr < *bptr) ? -1 : 1;
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?