Closed andrebrov closed 7 years ago
Thank you for submitting the issue. I'll try to test it fix it.
I am also seeking the same behavior.
I overrode the dialect class to register a String Array to text
so my error message is:
Found _text, expected: text[]
UPDATE:
I fixed it for now, by changing the 2nd parameter of registerColumn to _text
Functionality appears to work fine with this change.
From PostgreSQL documentation:
Array Types
Whenever a user-defined type is created, PostgreSQL automatically creates an associated array type, whose name consists of the base type's name prepended with an underscore, and truncated if necessary to keep it less than NAMEDATALEN bytes long.
Adding registerColumnType(ArrayType.STRING_ARRAY, "_varchar");
in PostgresqlExtensionsDialect
can fix this bug.
I have a fix for this (thanks, @donbeave!) but foolishly I committed my previous change to master, rather than a branch, so the diff includes some UUID stuff. Anyway, check karaken12/grails-postgresql-extensions@3b55bc13ca1e179465283fbf9d825b3c762c0062 to see the changes.
@karaken12 can you do PR to this repository?
@donbeave Sure, I'll give it a go. It won't apply cleanly, though, as I mentioned.
Edit: Oh, apparently pull requests don't work the way I thought. :-( So, the changes I made are lumped in with my earlier PR for UUID array support. I'll make a new branch and PR that instead.
I think you can do one PR with this UUID support, looks good to me.
Looks good...not really part of this issue, but would be nice to also support _text
instead of only _varchar
Right, created a separate PR for this issue, which should apply cleanly. I already created a PR for UUID support: PR #93.
@sean7512 It's pretty easy to change it so it supports text[]
instead of varchar[]
, but I'm not so sure how to support both. Is there a big difference between them?
Thank you very much for the PRs. I'll try to review them during the following days but I can't promise anything because I'm really busy these days.
@karaken12 yes, its easy...I overrode it for my project as the existing database on my project uses text[]
, but it would be nice to be able to support both at the same time. I easily see a scenario where a database has a mix of them for some unknown reasons.
This change was included in #93 that is now merged on master. I've released the version 4.6.7
with this change.
Hi, In one of my domain class I have next fiels
pageKeywords type: ArrayType, params: [type: String]
When I usedbCreate = 'validate'
option in data source config I'm getting next error:Wrong column type in public.sc_page for column page_keywords. Found: _varchar, expected: varchar[]