title: Postgres SELECT where the WHERE is UUID or string
body: <p>I have the following simplified table in Postgres:</p>
  
  <ul>
  <li><strong>User Model</strong>
  
  <ul>
  <li>id (UUID)</li>
  <li>uid (varchar)</li>
  <li>name (varchar)</li>
  </ul></li>
  </ul>
  
  <p>I would like a query that can find the user on either its UUID <code>id</code> or its text <code>uid</code>.</p>
  
  <pre><code>SELECT * FROM user
  WHERE id = 'jsdfhiureeirh' or uid = 'jsdfhiureeirh';
  </code></pre>
  
  <p>My query generates an <code>invalid input syntax for uuid</code> since I'm obviously not using a UUID in this instance.</p>
  
  <p>How do I polish this query or check if the value is a valid UUID?</p>