title: How do I drop all invalid indexes in postgres?
body: <p>Using this query:</p>
  <p>I have hundreds of invalid indexes:</p>
  <p><code>SELECT * FROM pg_class, pg_index WHERE pg_index.indisvalid = false AND pg_index.indexrelid = pg_class.oid;</code></p>
  <pre><code> public  | post_aggregates_pkey_ccnew_ccnew_ccnew1
   public  | post_aggregates_post_id_key_ccnew_ccnew_ccnew1
   public  | idx_post_aggregates_stickied_hot_ccnew_ccnew_ccnew1
   public  | idx_post_aggregates_hot_ccnew_ccnew_ccnew1
  ...
  </code></pre>
  <p>They don't appear to be in use, and I have no idea why they are being created (seems to me that they shouldn't remain), as the original indexes still exist.</p>