Thanks everyone. I have this working now. I was unaware that like is case-insensitive; in PostgreSQL there is a separate "ilike". As a further complication, I just realised that I had created the column with type "datetime" - which gives it integer affinity. I've now changed it to text.