title: Is there a standard approach for dealing with unordered arrays (sets) in PostgreSQL?
body: <p>I have a table that contains pairs of words in two separate columns.  The order of the words is often important, but there are times when I simply want to aggregate based on the two words, regardless of order.  Is there a simple way to treat two rows with the same words but with different orders (one row the opposite of the other) as the same "set"?  In other words, treat:</p>
  
  <pre>
  apple orange
  orange apple
  </pre>
  
  <p>as:</p>
  
  <pre>
  (apple,orange)
  (apple,orange)
  </pre>