title: How do I append a schema to the postgresql database default search_path?
body: <p>I already know how to set the search_path per database or user (alter database set search_path to schema1, schema2, ...).</p>
  
  <p>What I would like to do is append a schema to the default search path. I know I can get the current search path (show search_path) but this could have been altered during the session.</p>
  
  <p>The purpose is something like:</p>
  
  <pre><code>create schema postgis;
  set search_path to postgis;
  create extension postgis;
  alter database the_db set search_path to &lt;the current default&gt;, postgis;
  </code></pre>
  
  <p>I can do this manually but I want to add this to a function that could be called after the user altered the session search path.</p>