DB.get(Sequel.lit("'a=>b'::hstore")).class # => Sequel::Postgres::HStore
This works as expected. I think that problem is once manipulating
with Sequel::Postgres::JSONHash or Sequel::Postgres::HStore directly
(directly means changing value of some key)...
model.hstore_attr = { foo: 'bar' }
model.save # works
model.hstore_attr # => { foo: 'bar' }
model.hstore_attr[:foo] = 'boar'
model.save # Sequel::Error: can't express
#<Java::OrgPostgresqlUtil::PGobject:0x6c26cb7b> as a SQL literal
On Monday, September 22, 2014 11:43:29 PM UTC+2, Jeremy Evans wrote:
>
> For some reason you are dealing with a Java object instead of a ruby
> object. I posted about troubleshooting this earlier, but I'm not sure if
> you tried this, so let's try again.
>
> To troubleshoot, try to put together the simplest example:
>
> DB = Sequel.connect("jdbc:postgresql://...")
> DB.extension :pg_hstore
> p DB.get(Sequel.lit("'a=>b'::hstore")).class
>
> If that doesn't print Sequel::Postgres::HStore, then that is a problem.
> In that case, run this code to get the hstore oid:
>
> p DB.from(:pg_type).where(:typtype=>'b',
> :typname=>'hstore').select_map([:oid, :typname])
>
> Also, run this code to get the schema for the table:
>
> p DB.schema(:table_name)
>
> Post the results here and hopefully we can find the underlying issue.
>
> Thanks,
> Jeremy
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.