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:Error when searching list containing association_id columns #1114

Open
e2 opened this issue May 7, 2012 · 0 comments
Open

PG:Error when searching list containing association_id columns #1114

e2 opened this issue May 7, 2012 · 0 comments
Assignees

Comments

@e2
Copy link

e2 commented May 7, 2012

When I do a search on a list of records, I get:

PG::Error: ERROR:  operator does not exist: integer ~~* unknown
LINE 1: ...ntent ILIKE '%great%') OR (comments.user_id ILIKE '%gr...

because Postgres is picky about using ILIKE on integers (user_id).

Works in sqlite of course.

The reason user_id is in the search field is my fault, because I accidentally
added field :user_id instead of :user in the RailsAdmin config block.

A fix might be to cast anything passed to ILIKE to a string to avoid crashes or
use the type definition from the DB adaptor directly. I'm not sure.

NOTE: I'm behind HEAD somewhat, so I don't know if this still applies.

Let me know if you need anything else.

@mshibuya mshibuya self-assigned this Mar 10, 2015
@mshibuya mshibuya added this to the 0.7 milestone Mar 10, 2015
@sferik sferik modified the milestones: 1.0.0, 1.1.0 Sep 19, 2016
@mshibuya mshibuya removed this from the 1.1.0 milestone Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants