-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array of custom types deserialization problem #44
Comments
Hi @anakryiko I can't understand your problem, pls check my pg composite support tests here, which is similar to your case, but looks good. |
Hmm.. that's strange, I use exactly the same custom type mappers as in your tests. But either way, what can cause this error in your code? Also, changing spaces to underscores fixes the problem, so it is definitely the problem with spaces. |
Ok, I just confirmed why your tests are passing and my data causes errors. I created another custom type, where first field is not string. Then it doesn't fail. Can you try to change the order of your fields so that the first field is String (with spaces)? So in my case, this fails: {"("ABC ABC",1,0)"} and this doesn't: {"(1, "ABC ABC")"} Can this be fixed fast or should I alter all my custom data types? |
Well, I'll check and fix it ASAP. Thanks for your pointing it out! |
Hi @anakryiko I added one more test for composite support, which is very similar to your case. |
Ok, so I checked your test on my Db -- it worked, so I started to dig deeper. Can you check with the following changes to your tests:
The only difference (though it shouldn't matter) is that I created types and tables and put the data into table manually, not through your code. So, it turns out to be some very specific combination of fields that triggers this error. I hope that's helpful in finding bug. |
Hi @anakryiko I published Pls update your libraryDependencies += "com.github.tminglei" % "slick-pg_2.10" % "0.5.2.2" Thanks for your nice help :) |
Hi, I've updated to 05.2.2 and verified that the bug was fixed! |
You're welcome :) |
Hi,
I have a column which type is array of my custom types:
where bom_entry is
If the ipn contains a text that has spaces inside, I get the following error (see at the bottom).
If I change the value to ABC_ABC everything works. It seems like slick-pg has problem with deserializaing this representation of array (as presented in psql). Is the problem in escaping?
I think the problem is in escaping quotes and quotes are added by PostgreSQL only if there are spaces. With ABC_ABC value, the output is as following:
I created custom type mapper as per your samples.
Can this be fixed somehow? Thanks!
The text was updated successfully, but these errors were encountered: