title: Get encrypted password for PostgreSQL login role
body: <p>Is there a way to fetch the encrypted password for a login roll from a PostgreSQL server?</p>
  
  <p>To give some insight into my problem, I'm trying to manage the <code>postgres</code> user's password via Ansible. To do so, I would like to check the current value of the encrypted password (e.g. <code>'md5...'</code>) to see if it's current or not. If it is not, I would execute the appropriate <code>ALTER ROLL</code> command to update it.</p>
  
  <p>I know I can use <code>pg_dumpall</code> to <em>see</em> the password, e.g:</p>
  
  <pre><code>$ pg_dumpall --roles-only
  &lt;snip&gt;
  CREATE ROLE postgres;
  ALTER ROLE postgres WITH ... PASSWORD 'md5...';
  </code></pre>
  
  <p>But this doesn't seem like a very reliable way of doing so.</p>