PostgreSQL case insensitive SELECT on array
问题 I'm having problems finding the answer here, on google or in the docs ... I need to do a case insensitive select against an array type. So if: value = {"Foo","bar","bAz"} I need SELECT value FROM table WHERE 'foo' = ANY(value) to match. I've tried lots of combinations of lower() with no success. ILIKE instead of = seems to work but I've always been nervous about LIKE - is that the best way? 回答1: One alternative not mentioned is to install the citext extension that comes with PostgreSQL 8.4+