Rails SQL query with % Wildcards works in SQLite but not PostgreSQL?
问题 I have a query I'm using for a search with :conditions like this: :conditions => ['family_name LIKE ? OR given_name LIKE ?', "%#{params[:search]}%", "%#{params[:search]}%"] The query works fine locally on SQLite, but when I push to Heroku on PostgreSQL, only the first % works for both family_name and given_name. In other words, it will match a keyword that occurs at the end of a word but not the beginning or middle. Example: There is an existing record with :family_name => "Washington" and