title: Find duplicate rows with PostgreSQL
body: <p>We have a table of photos with the following columns: </p>
  
  <pre><code>id, merchant_id, url 
  </code></pre>
  
  <p>this table contains duplicate values for the combination <code>merchant_id, url</code>. so it's possible that one row appears more several times. </p>
  
  <pre><code>234 some_merchant  http://www.some-image-url.com/abscde1213
  235 some_merchant  http://www.some-image-url.com/abscde1213
  236 some_merchant  http://www.some-image-url.com/abscde1213
  </code></pre>
  
  <p>What is the best way to delete those duplications?
  (I use PostgreSQL 9.2 and Rails 3.)</p>