title: postgres counting one record twice if it meets certain criteria
body: <p>I thought that the query below would naturally do what I explain, but apparently not...  </p>
  
  <p>My table looks like this:</p>
  
  <pre><code>id | name | g | partner | g2
  1 | John | M | Sam | M
  2 | Devon | M | Mike | M
  3 | Kurt | M | Susan | F
  4 | Stacy | F | Bob | M
  5 | Rosa | F | Rita | F
  </code></pre>
  
  <p>I'm trying to get the id where either the g or g2 value equals 'M'... But, a record where both the g and g2 values are 'M' should return two lines, not 1.  </p>
  
  <p>So, in the above sample data, I'm trying to return:</p>
  
  <pre><code>$q = pg_query("SELECT id FROM mytable WHERE ( g = 'M' OR g2 = 'M' )");
  
  1
  1
  2
  2
  3
  4
  </code></pre>
  
  <p>But, it always returns:</p>
  
  <pre><code>1
  2
  3
  4
  </code></pre>