>>>>> "Peter" == Peter Eisentraut <pete...@gmx.net> writes:

 >> I have table with bytea column, which is indexed (1)
 >> I want to use index during pattern matching (eg. dir like
 >> someDirectoryName
 >> || '/%'), but concatenation of two strings cause error (2)
 >> So I have to use function convert_to (converting text to bytea), but
 >> this
 >> has awful explain plan (3)

 Peter> You haven't told us how the convert_to function is defined.

convert_to is a builtin function. If there's a bug here, it's that
convert_to is defined as stable rather than immutable. (Sure it depends
on server_encoding, but that can't exactly change... if there's any
other reason why it's not immutable, I can't think what it is.)

Example (5) from the original message is the correct approach in any
case; as long as either operand of the || is explicitly passed as, or
cast to, a bytea, then it should work.

-- 
Andrew (irc:RhodiumToad)

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to