title: Rails PostgreSQL: column "table_rows" does not exist (ActiveRecord::StatementInvalid)
body: <p>All of a sudden I have this weird error when running test. <code>rails 4.1.5</code> <code>pg 0.18.1</code></p>
  
  <p>Tried to drop and recreate databases, but nothing helps. Development seems to be working, just not tests.</p>
  
  <p><code>RAILS_ENV=test rake db:create db:migrate</code></p>
  
  <p>Please advise.</p>
  
  <pre><code>...gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/
  database_statements.rb:128:in `async_exec':
  PG::UndefinedColumn: ERROR:  
  column "table_rows" does not exist (ActiveRecord::StatementInvalid)
  LINE 1: ...chema.tables WHERE table_schema = 'real_test' AND table_rows...
                                                               ^
  : SELECT table_name FROM information_schema.tables WHERE table_schema = 'real_test' AND table_rows &gt; 0
  from ...ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
  from ...ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
  from ...ruby/gems/2.2.0/gems/activesupport-4.1.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  ...
  </code></pre>
  
  <p>Full backtrace:</p>
  
  <pre><code>$ rspec
  Run options: include {:focus=&gt;true}
  
  All examples were filtered out; ignoring {:focus=&gt;true}
  
  Randomized with seed 14295
  
  Finished in 0.09195 seconds (files took 4.81 seconds to load)
  0 examples, 0 failures
  
  Randomized with seed 14295
  
  /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec': PG::UndefinedColumn: ERROR:  column "table_rows" does not exist (ActiveRecord::StatementInvalid)
  LINE 1: ...chema.tables WHERE table_schema = 'real_test' AND table_rows...
                                                               ^
  : SELECT table_name FROM information_schema.tables WHERE table_schema = 'real_test' AND table_rows &gt; 0
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.1.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/active_record/deletion.rb:57:in `tables_with_new_rows'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/active_record/deletion.rb:49:in `tables_to_truncate'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/active_record/deletion.rb:80:in `block in clean'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/referential_integrity.rb:17:in `disable_referential_integrity'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/active_record/deletion.rb:79:in `clean'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/base.rb:40:in `clean_with'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/configuration.rb:91:in `block in clean_with'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/configuration.rb:91:in `each'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/database_cleaner-1.4.0/lib/database_cleaner/configuration.rb:91:in `clean_with'
          from /Users/pain/Sites/real/spec/features/acceptance_helper.rb:40:in `block (2 levels) in &lt;top (required)&gt;'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/example.rb:331:in `instance_exec'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/example.rb:331:in `instance_exec'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/hooks.rb:350:in `run'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/configuration.rb:1525:in `block in run_hooks_with'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/configuration.rb:1525:in `each'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/configuration.rb:1525:in `run_hooks_with'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/configuration.rb:1499:in `with_suite_hooks'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/runner.rb:109:in `block in run_specs'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/reporter.rb:62:in `report'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/runner.rb:108:in `run_specs'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/runner.rb:86:in `run'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/runner.rb:70:in `run'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/lib/rspec/core/runner.rb:38:in `invoke'
          from /Users/pain/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/rspec-core-c22e9023dacb/exe/rspec:4:in `&lt;top (required)&gt;'
          from ./bin/rspec:16:in `load'
          from ./bin/rspec:16:in `&lt;main&gt;'
  </code></pre>