This project is archived and is in readonly mode.
PostgreSQLAdapter: Postgres Error while finding when using a function with two parameters in order clause
-
Pratik
- Assigned user set to Tarmo Tänav
-
jay
The old Trac-based dev site has a similar issue posted along with a patch that may help:
http://dev.rubyonrails.org/ticke...
I ran across a related issue yesterday when using PostgreSQL 8.3's NULLS FIRST/LAST clause in ordering. The aforementioned patch may help as it contains a small parser that looks for parenthesis and the like in function calls and also handles the NULLS FIRST/LAST issue, so I'll give it a shot and see how it goes.
-
jay
Okay, I've applied the aforementioned patch courtesy of gravatite against the master head and attached the diff. I had a go at a couple of tests, but frankly, not being overly familiar with ActiveRecord's tests, I don't know how complete or useful they are. They're there, though, and at least the patch doesn't appear to break any existing tests.
-
Ruy Asan
I also have ran into this problem when trying to use postgresql's tsearch module for fulltext search.
In general, any use of functions as order-by clauses will trigger this. Letting :order take arrays is going to be by far the best solution i think.
-
Santiago Pastorino
- State changed from new to open
- Importance changed from to
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
