title: Can't set schema_name in dockerized PostgreSQL database
body: <p>I'm trying to setup a PostgreSQL Docker Container. I want to create a schema on startup and set <code>search_path</code> to that schema.<br>
  I've created an initialization .sql file and it's copied to the <code>/docker-entrypoint-initdb.d/</code> folder where it's executed by <code>docker-entrypoint.sh</code> file on the container's startup. The entrypoint file comes from <a href="https://github.com/docker-library/postgres/blob/7da010d82077944ce39211cc610ce58c11366360/9.6/docker-entrypoint.sh" rel="nofollow noreferrer">the official docker library repo</a>.<br>
  This .sql file contains the following code:</p>
  
  <pre><code>CREATE SCHEMA solwa_dev;
  SET search_path TO solwa_dev;
  -- table creations, sequences, other commands
  </code></pre>
  
  <p>Everything executes properly, but after the initialization completes <code>search_path</code> is not setup accordingly. If I type this in a terminal:</p>
  
  <pre><code>docker exec -it &lt;docker_container&gt; psql -U postgres -c "show search_path;"
  </code></pre>
  
  <p>it shows <code>"$user", public"</code>. After I use the same command to <code>SET search_path TO solwa_dev;</code> it still shows both $user and public schemas, but no solwa_dev schema!</p>
  
  <p>Why is this happening and how can I solve this problem?</p>