PostgreSQL trim() and ANY() functions