ricardochimal / taps

simple database import/export app
MIT License
1.2k stars 140 forks source link

Data select fails due to explicit casts required in Postgres > 8.3 #141

Open fero8 opened 10 years ago

fero8 commented 10 years ago

Error dump:

!!! Caught Server Exception HTTP CODE: 500 Taps Server Error: PG::UndefinedFunction: ERROR: operator does not exist: character varying > integer LINE 1: SELECT * FROM "search_index" WHERE ("word" > 0) ORDER BY "wo... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

["/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:inasync_exec'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in block (2 levels) in execute'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/database/logging.rb:28:inlog_yield'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in block in execute'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:158:incheck_disconnect_errors'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in execute'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:240:inblock (2 levels) in execute'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:84:in hold'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:insynchronize'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:240:in block in execute'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:261:incheck_database_errors'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:238:in execute'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:541:inexecute'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:319:in fetch_rows'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:123:ineach'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:50:in all'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/data_stream.rb:291:inblock in load_buffer'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/data_stream.rb:284:in loop'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/data_stream.rb:284:inload_buffer'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/data_stream.rb:304:in fetch_buffered'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/data_stream.rb:320:infetch_rows'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/data_stream.rb:116:in fetch'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/server.rb:181:inblock (2 levels) in '", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/db_session.rb:15:in block in conn'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:76:inconnect'", "/Library/Ruby/Gems/2.0.0/gems/sequel-3.20.0/lib/sequel/core.rb:119:in connect'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/db_session.rb:14:inconn'", "/Library/Ruby/Gems/2.0.0/gems/taps-0.3.24/lib/taps/server.rb:178:in block in <class:Server>'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:865:incall'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:865:in block in route'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:521:ininstance_eval'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:521:in route_eval'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:500:inblock (2 levels) in route!'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:497:in catch'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:497:inblock in route!'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:476:in each'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:476:inroute!'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:601:in dispatch!'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:411:inblock in call!'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:in instance_eval'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:inblock in invoke'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:in catch'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:ininvoke'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:411:in call!'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:399:incall'", "/Library/Ruby/Gems/2.0.0/gems/rack-1.0.1/lib/rack/deflater.rb:13:in call'", "/Library/Ruby/Gems/2.0.0/gems/rack-1.0.1/lib/rack/auth/basic.rb:25:incall'", "/Library/Ruby/Gems/2.0.0/gems/rack-1.0.1/lib/rack/commonlogger.rb:20:in _call'", "/Library/Ruby/Gems/2.0.0/gems/rack-1.0.1/lib/rack/commonlogger.rb:13:incall'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:979:in block in call'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:1005:insynchronize'", "/Library/Ruby/Gems/2.0.0/gems/sinatra-1.0/lib/sinatra/base.rb:979:in call'", "/Library/Ruby/Gems/2.0.0/gems/rack-1.0.1/lib/rack/content_length.rb:13:incall'", "/Library/Ruby/Gems/2.0.0/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in service'", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:138:inservice'", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:94:in run'", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:295:inblock in start_thread'"]`

More info: http://petereisentraut.blogspot.cz/2008/03/readding-implicit-casts-in-postgresql.html