title: postgres createuser with password from terminal
body: <p>I'm using vagrant to setup a new Ubuntu machine. With provisioning I'm in the need to create a new postgres user. Currently I'm using:</p>
  
  <pre><code>sudo su postgres
  createuser -P myuser
  </code></pre>
  
  <p>Unfortunately provisioning fails because a prompt needs to be filled with password (<code>-P</code> flag). </p>
  
  <p>Is there a way to pass the password to <code>createuser</code> like <code>createuser myuser --password test</code> or <code>echo test | createuser -P myuser</code>?</p>