Postgres sql error

getting the error shown below on a simple “find_by_name” for an active
record. I’ve seen this with migrations when creating tables with
“force => true” but never a simple select like this. There is nothing
wrong with the sql. It runs fine in pgadmin.

ActiveRecord::StatementInvalid: RuntimeError: ERROR C25P02 Mcurrent
transaction is aborted, commands
ignored until end of transaction block Fpostgres.c L859
Rexec_simple_query: SELECT * FROM destinations WHERE
(destinations.“name” = ‘foo bar’) LIMIT 1
/var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
connection_adapters/abstract_adapte
r.rb:128:in log' /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ connection_adapters/postgresql_adap ter.rb:152:inexecute’
/var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
connection_adapters/postgresql_adap
ter.rb:433:in select' /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ connection_adapters/abstract/databa se_statements.rb:7:inselect_all’
/var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:427:in find_by_sql' /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ base.rb:997:infind_every’
/var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:991:in find_initial' /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ base.rb:1204:insend’
/var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1204:in method_missing' /var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ deprecation.rb:44:insilence’
/var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1204:in `method_missing’
/home/dsailer/aptana/workspace/OrbRuby/config/…/lib/juniper/
stats_helper.rb:41

I found the “real” problem in /var/log/postgresql/postgresql-8.2-
main.log. It was actually an error on the previous sql statement. This
seems like a rails bug to me, and a really annoying one. Had me off-
track for awhile.

lesson: don’t count on the rails log files. Check the db log files.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs