title: PG::Error: ERROR: zero-length delimited identifier at or near """"
body: <p>I just did a dump of my staging databse, than did pg_restore on my local postgres databse to get them to line up. All the data went through.</p>
  
  <p>Now when I try to query in the Rails console, I get errors.</p>
  
  <pre><code>Artist.count
     (0.5ms)  SELECT COUNT(*) FROM "artists" 
  =&gt; 668
  </code></pre>
  
  <p>**</p>
  
  <pre><code>Artist.last
    Artist Load (1.4ms)  SELECT "artists".* FROM "artists" ORDER BY "artists"."" DESC LIMIT 1
  PG::Error: ERROR:  zero-length delimited identifier at or near """"
  LINE 1: ...T  "artists".* FROM "artists"  ORDER BY "artists"."" DESC LI...
                                                               ^
  : SELECT  "artists".* FROM "artists"  ORDER BY "artists"."" DESC LIMIT 1
  ActiveRecord::StatementInvalid: PG::Error: ERROR:  zero-length delimited identifier at or near """"
  LINE 1: ...T  "artists".* FROM "artists"  ORDER BY "artists"."" DESC LI...
                                                               ^
  : SELECT  "artists".* FROM "artists"  ORDER BY "artists"."" DESC LIMIT 1
  from /Users/ryanrebo/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `exec'
  </code></pre>
  
  <p>I get the same error on all other Models. I also cannot use <code>find(id)</code>. </p>
  
  <p>Any ideas?</p>