-
Notifications
You must be signed in to change notification settings - Fork 77
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
Upserting with Array does not work #38
Comments
It seems that's the problem caused by having the array values as "{'12345','23456'}" and "{'test','test2'}", instead of '{"12345","23456"}' and '{"test","test2"}'. And integer[] should looks like '{12345,23456}' instead anyway. |
hi @achiinto would you show some sample code? also please show the table structure (using |
hi @seamusabshere, sorry that I have been busy. My project currently is not using the gem anymore. But at soon as I can get back to it, I will try to reproduce it in a brand new project to verify the issue. |
@achiinto would love to see a test, after which we can probably support this functionality using http://rubygems.org/gems/pg_array |
I have some free time now, let me get back to it. I am getting curious too. |
Is this still an issue? Postgres arrays work okay with Rails 4.2 |
I am using the gem with PostgreSQL and JRuby. Have anyone tried doing Upsert with Integer[] or character varying(255)[]? I can't seem to get it work and always getting:
"Hint: No function matches the given name and argument types. You might need to add explicit type casts."
When the same table is not upset with array attribute, everything worked fine. But when the array attributes are included, it failed. The "function" creation has integer[] and character varying(255)[] respectively, while the result sql has values "{'12345','23456'}" for the integer[] and "{'test','test2'}" for the string[].
Does it look right?
The text was updated successfully, but these errors were encountered: