Closed jglapa closed 5 years ago
Hi @jglapa,
Good catch! We're replacing all double-quotes with single-quotes here: https://github.com/kaleidos/grails-postgresql-extensions/blob/master/src/java/net/kaleidos/hibernate/usertype/HstoreHelper.java#L19
It would be great if you can fix the bug. I'll be more than happy accepting your pull request and generating a new version.
Regards, Iván.
Hi, it looks like "manually" inserted data(via psql) cannot be "parsed" by the extension. Hstore allows for the keys and values to contain double quote character but upon parsing we'll get an error as the escape character is not properly handled.
Executing this:
will result with the following in db:
Those \", ', \ sequences should be treated in a special way.
I guess this should be somehow handled in the HstoreParser.advanceQuoted or HstoreParser.advanceWord. Are there any bigger limitations or gotchas around this issue? I might try to face this bug.
Just to mention: currently the extension "corrupts" the data. If we insert a key with double quote character inside it will be convert to a single quote. This means if this string was a hstore key we wouldn't be able to look up the value having the original key.
Thanks! PS. Good job guys with the extension! Keep up the good work!