One idea: col like 'foo%' could be translated to col >= 'foo' and col <= foo || 'zzz' , where 'z' is the largest possible character.This should be good enough for calculating stats. How to find such a character, i do not know.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных