title: Setting PGPASSWORD environment variable for Postgres (psql) process executed by Inno Setup
body: <p>I needs to create a tablespace in Postgres with Inno Setup.</p>
  
  <p>I had run this on the command line:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>SET PGPASSWORD=P0stgres
  "C:\Program Files\PostgreSQL\9.4\bin\psql.exe" -h localhost -p 5432 -U postgres -d postgres -c "CREATE TABLESPACE TABLETEST OWNER postgres LOCATION E'{app}\\PATHTEST\\Db'"
  </code></pre>
  
  <p>I tried this in Inno Setup, but it did not work:</p>
  
  <pre class="lang-none prettyprint-override"><code>[Run]
  Filename: {sys}\cmd.exe; Parameters: "SET PGPASSWORD=P0stgres"
  Filename: {sys}\cmd.exe; Parameters: ""C:\Program Files\PostgreSQL\9.4\bin\psql.exe" -h localhost -p 5432 -U postgres -d postgres -c "CREATE TABLESPACE TABLETEST OWNER postgres LOCATION E'{app}\\PATHTEST\\Db'""
  </code></pre>
  
  <p>Regards</p>