title: Regularly seeing PG::InFailedSqlTransaction error when deploying rails app to heroku
body: <p>Whenever we deploy our Rails/Postgres app and a migration is part of the deploy we get the following error:</p>
  
  <blockquote>
    <p>PG::InFailedSqlTransaction: ERROR:  current transaction is aborted,
    commands ignored until end of transaction block</p>
    
    <p>PG::FeatureNotSupported: ERROR: cached plan must not change result
    type</p>
  </blockquote>
  
  <p>The offending SQL transaction is usually different.</p>
  
  <p>I'm wondering if there is a way to prevent this from happening when we deploy?</p>