where's the bug:

table test4 includes a column a bytea

select max(a) from test4 is not possible because max() is not defined on bytea. therefore i use select max(encode(a,'escape')) from test4 which works but is very slow.

i'd like to create a functional index:

create index i_test on test4 (encode(a,'escape'))

where is the problem ?

that's the message:
ERROR: parser: parse error at or near "'escape'" at character 40