This project is archived and is in readonly mode.

#3465 ✓invalid
Paul Sadauskas (Rando)

Postgres Adapter generates invalid quoted table names

Reported by Paul Sadauskas (Rando) | November 6th, 2009 @ 12:26 AM

Rails3 6c59e5a (but has been happening for a couple weeks, since around the time of the arel merge.)
(PostgreSQL) 8.4.1 pg gem 0.8.0

Gives me the error:

ActiveRecord::StatementInvalid in 'GET /escalation_defintions ssj with authorization before(:all)'
PGError: ERROR:  relation "escalation_definitions" does not exist
LINE 4:              WHERE a.attrelid = '"escalation_definitions"'::...
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"escalation_definitions"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum

/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:211:in `log'
/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:539:in `query'
/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:1094:in `column_definitions'
/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:707:in `columns'
/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/base.rb:1318:in `columns'
/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/base.rb:2967:in `attributes_from_column_definition_without_lock'
/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition'
/home/rando/development/api/alarm/vendor/gems/dirs/rails/activerecord/lib/active_record/base.rb:2396:in `initialize'
/home/rando/development/api/alarm/vendor/gems/gems/machinist-1.0.5/lib/machinist/active_record.rb:53:in `new'
/home/rando/development/api/alarm/vendor/gems/gems/machinist-1.0.5/lib/machinist/active_record.rb:53:in `make'
./spec/services/escalation_definition_ssj_spec.rb:7:
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/example/example_methods.rb:70:in `instance_eval'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/example/example_methods.rb:70:in `eval_each_fail_fast'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/example/example_methods.rb:70:in `each'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/example/example_methods.rb:70:in `eval_each_fail_fast'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/example/example_group_hierarchy.rb:13:in `run_before_all'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/example/example_group_methods.rb:199:in `run_before_all'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/example/example_group_methods.rb:102:in `run'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/runner/example_group_runner.rb:23:in `run'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/runner/example_group_runner.rb:22:in `each'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/runner/example_group_runner.rb:22:in `run'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/runner/options.rb:151:in `run_examples'
/home/rando/development/api/alarm/vendor/gems/dirs/rspec/lib/spec/runner/command_line.rb:9:in `run'

It works OK on rev cbb70c896cc97077f851c1410a9fee98ca707a36, which is the latest I've tested. Significant changes to the structure of rails apps prevent me from bisecting to find the exact issue.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Tags

Pages