title: How to rollback all open PostgreSQL transactions
body: <p>How do I rollback <em>all</em> open postgres transactions for a specific database?</p>
  
  <p>Can I do it by combining these 2 statements somehow?</p>
  
  <pre><code>-- get transaction identifiers
  SELECT gid FROM pg_prepared_xacts WHERE database='mydb';
  
  -- rollback transaction by identifier
  ROLLBACK PREPARED 'GID';
  </code></pre>