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

Food for though concept of multiple dimension array support #75

Open gregopet opened 8 years ago

gregopet commented 8 years ago

Wanted to stir up a debate about multi-dimensional arrays, see commit comments..

ilopmar commented 8 years ago

Thank you very much for your proposal. The thing is that I haven't needed multi-dimensional arrays so that's why the plugin doesn't support them at this moment. I'm more than willing to merge this PR if you add the tests and some documentation.

I'm asking you because I haven't used them. What operators or new criterias do you think we'll need to create to be able to query this new multi-dimensional arrays? If you can create a list of the most useful maybe we can implement them.

I totally understand your use case because you were mapping a legacy database. For a new development I think jsonb is more powerful that arrays, but maybe I'm wrong.

gregopet commented 8 years ago

Challenge accepted, though it won't happen very soon I'm afraid - I'm swamped with work right now and have pushed back all tasks that have offered 'resistance', such as the multi dimensional array. I'll have to check out what Postgres offers, anyway - perhaps it would be better to scrap the fixed dimensions and map a List where each member is either another such list or an element of the declared type because that's probably what Postgres allows, too.

Generally I agree about jsonb, although in my use case the 2-tuples actually seem to make perfect sense. Anyway, I'll get back to this issue when I start working with the array data and have a better understanding of the mechanics.