Here's a new patch.
> Looks like you missed one VarChar -> bytea.
Fixed.
> I think it's better style to code stuff like this as
>
> PG_RETURN_BOOL((cmp < 0) || ((cmp == 0) && (len1 < len2)));
Done.
> The biggie is that you missed adding support for bytea to scalarltsel,
> which puts a severe crimp on the optimizer's ability to make any
> intelligent decisions about using your index.
Hopefully done correctly ;-)
-- Joe