"David E. Wheeler" <[EMAIL PROTECTED]> writes: > lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left)); > rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
> result = varstr_cmp( > lcstr, > VARSIZE_ANY_EXHDR(left), > rcstr, > VARSIZE_ANY_EXHDR(right) > ); Not sure about a memory leak, but this code is clearly wrong if str_tolower results in a change of physical string length (clearly possible in Turkish, for instance, and probably in some other locales too). You need to do strlen's on the lowercased strings. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers