Skip to content
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

"PG::InvalidTextRepresentation: ERROR: missing dimension value" for Array param #28

Closed
beno opened this issue Mar 7, 2014 · 1 comment

Comments

@beno
Copy link

beno commented Mar 7, 2014

I am using an Array type parameter an run into the following error when writing to the database.

SEQUEL DEPRECATION WARNING: Automatically typecasting a hash or array to string for a string column is deprecated and will be removed in Sequel 4.0.  Either typecast the input manually or use the looser_typecasting extension.
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/database/misc.rb:498:in `typecast_value_string'
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/database/misc.rb:289:in `typecast_value'
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/model/base.rb:1988:in `typecast_value'
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/model/base.rb:1056:in `[]='
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/model/base.rb:769:in `tags='
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/model/base.rb:1922:in `block in set_restricted'
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/model/base.rb:1919:in `each'
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/model/base.rb:1919:in `set_restricted'
.../bundle/ruby/2.1.0/gems/sequel-3.48.0/lib/sequel/model/base.rb:1414:in `set'
.../bundle/ruby/2.1.0/bundler/gems/rack-push-notification-74486fdea05a/lib/rack/push-notification.rb:37:in `block in <class:PushNotification>'
Sequel::DatabaseError - PG::InvalidTextRepresentation: ERROR:  missing dimension value
LINE 1: ...ags", "timezone", "token") VALUES ('nl_NL', 'en', '["iPhone ...
                             ^

More specifically, to resolve a conflict I have updated the dependencies of 'rack-push-notification' and the 'tags' parameter gives me the error. For completeness sake, the action that causes the error looks like this:

put '/devices/:token/?' do
  param :languages, Array
  param :tags, Array
  ...

The database column has type 'text[]'.

Even though I smuggled with the dependencies, this looks like a pretty generic thing?

@mattt
Copy link
Owner

mattt commented Mar 7, 2014

This is an issue with rack-push-notification. sinatra-param coerces to an Array object as expected, but rack-push-notification doesn't have the Postgres pg_array extensions loaded correctly.

Please open an issue for that project, if one does not currently exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants