On Lunes, 13 de Septiembre de 2010 23:35:36 coalex escribió:
> OK, Looks like something happen after Postgresql 8.2.6 that breaks the
> AS searching.
>
> Postgresql barfs on the use of the "lower" function in the AS query
> string in searching.
>
> So an example:
> select * from tables where lower(whatever) like '%some_search_string
> %'  <--Fails with something like:
>
> ERROR: No function matches the given name and argument types. You
> might need to add explicit type casts.

I think it's problem with client and server encoding. Have you tried in 
postgres console? Try too show client_encoding; and show server_encoding;

Are you using utf8? Do you have encodign: utf8 in your database.yml?

>
> OK with explicit type casts, fixes the issue:
> select * from tables where lower(whatever::TEXT) like
> '%some_search_string%' <--works fine.
>
>
> Needless to say.
> I've been fumbling around looking for a place to add :TEXT (explicit
> type cast) to the search string so I can update postgresql.
>
> Thought it was here:  /vendor/plugins/active_scaffold/lib/actions/
> search.rb
>
> Would have love to do something like:
> includes_for_search_columns.collect! { |x| x + "::TEXT"}  # But this
> just builds the columns (relations) to search not the actual fields to
> search in the query string.
>
> Anybody no where this happens? ..I'll post if I find it first.
>
> Thanks ALL!

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to