title: How to set PGOPTIONS when starting Postgres using docker-compose
body: <p>I want to start a Postgres database using <code>docker-compose</code> and pass some configurations using the <a href="https://www.postgresql.org/docs/9.1/static/config-setting.html" rel="nofollow noreferrer"><code>PGOPTIONS</code> environment variable</a>. My <code>docker-compose.yml</code> looks like this:</p>
  
  <pre><code>version: '2'
  
  services:
    db:
      image: postgres
      environment:
       - POSTGRES_USER=dbuser
       - POSTGRES_PASSWORD=dbpw
       - PGOPTIONS='-c track_activities=on -c track_counts=on -c track_io_timing=on'
  </code></pre>
  
  <p>When I start this service using <code>docker-compose up db</code> I get:</p>
  
  <pre><code>db_1   | FATAL:  parameter "track_io_timing" requires a Boolean value
  db_1   |  done
  db_1   | server started
  db_1   | FATAL:  parameter "track_io_timing" requires a Boolean value
  db_1   | psql: FATAL:  parameter "track_io_timing" requires a Boolean value
  </code></pre>
  
  <p>It does not seem to be related to the <code>tracking_io_timing</code> parameter, because when I remove that one from the <code>PGOPTIONS</code> variable I get the same error, but for the <code>track_counts</code> variable. So I suspect there is something wrong with the way I declared <code>PGOPTIONS</code>.</p>