title: locale issue while upgrading data directory from PostgreSQL 8.4 to 9.5
body: <p>I am upgrading PostgreSQL 8.4 to 9.5 on Windows. Following are the steps that are to be followed:</p>
  <ol>
  <li>Install PostgreSQL 9.5 (8.4 is already installed).</li>
  <li>Migrate data from 8.4's data dir to 9.5's data dir using pg_upgrade utility.</li>
  <li>After successful upgrade, uninstall PostgreSQL 8.4</li>
  </ol>
  <p>Here the issue is that PostgreSQL 8.4 could be installed with any locale (English or French etc.) and to have successful data directory upgrade, PostgreSQL 9.5 must be installed with the same locale as that of 8.4.</p>
  <p>Supplying the output of query '<em>Show lc_collate</em>' (executed on PostgreSQL 8.4) to PostgreSQL 9.5 installation leads to failed installation. It generates the error '<em>specified locale is not supported</em>'.</p>
  <p>Here is the example:</p>
  <p>Output (PostgreSQL 8.4) of query '<em>SHOW LC_COLLATE</em>': <em>English_United States.1252</em></p>
  <p>A. <em>--locale &quot;English_United States.1252&quot;</em></p>
  <p>While installing PostgreSQL 9.5, If we pass locale option as above, installer aborts with  an error <em>'specified locale is not supported'</em>.</p>
  <p>B. <em>--locale &quot;English, United States&quot;</em></p>
  <p>If we pass locale option as above, installation is successful and cluster locale is set to 'English, United States'.</p>
  <p><strong>Given that one has access to PostgreSQL 8.4, how would one know what value to pass to the parameter <em>--locale</em> while installing PostgreSQL 9.5?</strong></p>
  <hr />
  <p><strong>UPDATE:</strong></p>
  <p>If PostgreSQL 8.4 is installed with following <em>--locale</em> values</p>
  <ol>
  <li><p><em>--locale &quot;English_United States.1252&quot;</em></p>
  <p>Installation fails, gives same error: 'Locale specified is not supported.'</p>
  </li>
  <li><p><em>--locale &quot;English, United States&quot;</em></p>
  <p>Successful Installation, value of '<em>Show lc_collate</em>': <em>English, United States</em></p>
  </li>
  <li><p>No Value (i.e. parameter <em>--locale</em> is not provided during installation)</p>
  <p>Successful Installation, value of '<em>Show lc_collate</em>': <em>English_United States.1252</em></p>
  </li>
  </ol>
  <p>If you notice point 1. and 3., locale value is stored as <em>English_United States.1252</em> but can not be given as a value of parameter during installation. This seems to me as a bug.</p>
  <p>Please let me know how to tackle this issue ?</p>
  <p>In my case, <em>--locale</em> parameter was not provided during PostgreSQL 8.4 installation [scenario 3].</p>