title: Postgres: Finding search_path for given user and modifying it permanently
body: <p>I want to find the search_path for the current user and modify it permanently.</p>
  
  <p>I can find it using <code>show search_path</code> but when I try to find out using the below query, then it returns nothing</p>
  
  <pre><code>SELECT r.rolname, d.datname, rs.setconfig
  FROM   pg_db_role_setting rs
  LEFT   JOIN pg_roles      r ON r.oid = rs.setrole
  LEFT   JOIN pg_database   d ON d.oid = rs.setdatabase
  WHERE  r.rolname = 'vishal' 
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>Why these 2 returns the different result. I think <code>show search_path</code> returns the default value as <code>"$user", public</code> if nothing is found.</p></li>
  <li><p>Is it ok to set the current user's search_path permanently by finding it using <code>show search_path</code> and appending myschema to it by using below command? </p></li>
  </ol>
  
  <pre><code>ALTER ROLE vishal in DATABASE mydb set search_path = "$user", public, myschema;
  </code></pre>