On Thursday, July 16, 2015 at 3:28:48 PM UTC-6, binarypaladin wrote:
>
> I'm using some many_to_many associations with distinct: true. In general,
> they work as expected. However, if the table contains a JSON column, I get
> the following error:
>
> Sequel::DatabaseError: PG::UndefinedFunction: ERROR: could not identify
> an equality operator for type json
>
> What's the best workaround for this? I'd prefer it if I could tell
> distinct specifically which column to use for distinctness.
>
> PostgreSQL is 9.3.5 if that matters and Sequel is the latest.
>
For a workaround, instead of the :distinct option, use an association block:
many_to_many :foos do |ds|
ds.distinct(:column1, :column2)
end
I'm open to a patch that recognizes an array value for the :distinct option
and uses it as the arguments to Dataset#distinct.
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.