title: Simulating MySQL's ORDER BY FIELD() in Postgresql
body: <p>Just trying out PostgreSQL for the first time, coming from MySQL.  In our Rails application we have a couple of locations with SQL like so:</p>
  
  <pre><code>SELECT * FROM `currency_codes` ORDER BY FIELD(code, 'GBP', 'EUR', 'BBD', 'AUD', 'CAD', 'USD') DESC, name ASC
  </code></pre>
  
  <p>It didn't take long to discover that this is not supported/allowed in PostgreSQL. </p>
  
  <p>Does anyone know how to simulate this behaviour in PostgreSQL or do we have to pull sorting out into the code?</p>