Current search try to use lower() function in PG, thsi funciton only accepts an string since PG 8.4, so it will be a good idea to add coercion to the query to avoid problems with nil columns.
rewrite the quey to:
"lower(text(#{quote_attr(attr)})) LIKE ?"
is enough
Link to code
Related issue 638
Yep, having this issue in one of my production apps right now.
PG::UndefinedFunction: ERROR: function lower(integer) does not exist LINE 1: ... "categories" WHERE (lower(name) LIKE '%something%' OR lower(insu... [Truncated]
Not to self: fix this.
What is the update on this?
Thanks for highlighting this again!
I feel somewhat against fixing a bug (because it adds complexity to the query) which shows up with a version of Postgres so old. 8.4 reached EOL back in 2014-07.
Which environments are you seeing this issue with?
@nickcharlton
only accepts an string since PG 8.4
:p
Hah! I think I was a bit too vague!
If we're going to add additional maintenance burden (mostly on someone adding a change which breaks this _again_ in the future because it's forgotten about), I'd like to see how much this is still used.
Is this version of Postgres commonly used on public clouds/PaaS platforms/etc? Or just in a handful of company deployments?
Well, I use PG 9.6 or 10 so I'd say it's used often.
Anywho, I've encountered this bug as well in a previous project.
I had this problem in 9.5
I'm getting this error in 9.5. Specifically psql (PostgreSQL) 9.5.10
Scratch that. In my case, this was a mis-configured Field::String that is actually just a model getter (not an actual db field).
I _finally_ got my understanding around the right way, and I've merged in #1079 which should fix this. Thanks, everyone!
thanks @nickcharlton! better late than never
Sadly this took 18 months to be fixed so it undermined trust in Adminsitrate for me.
If Thoughtbot has not the resources to take care of this project I will suggest to open it's control to the community so it can regain some trust.
Regards
Hello everyone, I'm still getting this error no matter I tried to upgrade the gem version, any advice?
@nickcharlton any advice?
@helsayed We've not yet released a version with this fix in, but I'm doing the final few passes over issues before I do. In the meantime, I'd suggest bundling from the git repo.
@nickcharlton Thanks a lot
Most helpful comment
Yep, having this issue in one of my production apps right now.