title: Postgres pg_dump cache lookup failed for index
body: <p>I am trying to create a back-up of a postgres database using the following command (omitting details):</p>
  
  <pre><code>$ pg_dump -h $host -p 5432 -U $user $db &gt; db.sql
  </code></pre>
  
  <p>After some time, I get an error (formatted)</p>
  
  <pre><code>pg_dump: [archiver (db)] query failed: ERROR:  cache lookup failed for index 1184605879
  pg_dump: [archiver (db)] query was: 
  SELECT  t.tableoid, 
          t.oid, 
          t.relname AS indexname, 
          pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, 
          t.relnatts AS indnkeys, 
          i.indkey, 
          i.indisclustered, 
          false AS indisreplident, 
          t.relpages, 
          c.contype, 
          c.conname, 
          c.condeferrable, 
          c.condeferred, 
          c.tableoid AS contableoid, 
          c.oid AS conoid, 
          pg_catalog.pg_get_constraintdef(c.oid, false) AS condef, 
          (SELECT spcname FROM pg_catalog.pg_tablespace s WHERE s.oid = t.reltablespace) AS tablespace, 
          t.reloptions AS indreloptions 
  FROM pg_catalog.pg_index i 
  JOIN pg_catalog.pg_class t ON (t.oid = i.indexrelid) 
  LEFT JOIN pg_catalog.pg_constraint c ON (i.indrelid = c.conrelid AND i.indexrelid = c.conindid AND c.contype IN ('p','u','x')) 
  WHERE i.indrelid = '1184605870'::pg_catalog.oid AND i.indisvalid AND i.indisready 
  ORDER BY indexname
  </code></pre>
  
  <p>I then verified the index ID in <code>pg_index</code> does not exist. Is there some way to fix this, or some way to ignore this error and continue so I can continue exporting non-<code>pg_catalog</code> data?</p>