kaleidos / grails-postgresql-extensions

Grails plugin to use postgresql native elements such as arrays, hstores,...
Apache License 2.0
78 stars 62 forks source link

pgArrayContains and case sensitivity #26

Open aeischeid opened 10 years ago

aeischeid commented 10 years ago

wondering if there an easy way to check for pgArrayContains in a case insensitive way if it is a String[]? or if it would be easy to implement maybe

or is it best to simply store values forced into either upper or lower case and do the same with queries?

ilopmar commented 10 years ago

Hi Aaron,

We've been digging around and we have found the postgresql type citext: http://www.postgresql.org/docs/9.1/static/citext.html

I'm going to do some tests but I think I can create a new HibernateType that uses an array of citext instead of array of varchar.

Regards, Iván.

ilopmar commented 10 years ago

Hi @aeischeid,

I've been working on citext support and I have it almost working. You can check the WIP version in this branch: https://github.com/kaleidos/grails-postgresql-extensions/tree/array_citext

Currently it's possible to store Strings in citext columns but there is a problem when retrieving from the db and casting back to String.

Regards, Iván.

aeischeid commented 10 years ago

Sweet! I will try to give it a look later today.

ilopmar commented 10 years ago

Hi @aeischeid,

I've been doing some changes to support citext and you can see all of them in this PR #45.

Regards, Iván.