title: How to check if a postgres user exists?
body: <p><code>createuser</code> allows creation of a user (ROLE) in PostgreSQL. Is there a simple way to check if that user(name) exists already? Otherwise createuser returns with an error:</p>
  
  <pre><code>createuser: creation of new role failed: ERROR:  role "USR_NAME" already exists
  </code></pre>
  
  <p>UPDATE: The solution should be executable from shell preferrably, so that it's easier to automate inside a script.</p>