title: TimeOut on Create Unique Index Concurrently
body: <p>I am trying to create Unique Index on a table on my production box. For that:</p>
  <ol>
  <li><p>Have created a table TABLE1 with COLUMN1</p>
  </li>
  <li><p>Ran following command on my production DB(which is Postgres)</p>
  <pre><code> Create UNIQUE INDEX CONCURRENTLY idx_id_unique on TABLE1(COLUMN1)
  </code></pre>
  </li>
  </ol>
  <p>This is throwing error(after some time):</p>
  <blockquote>
  <p>2014-10-07 20:46:49.056 EDT ERROR:  cancelling statement due to statement timeout</p>
  <p>2014-10-07 20:46:49.056 EDT STATEMENT:  Create UNIQUE INDEX CONCURRENTLY idx_id_unique on TABLE1(COLUMN1)</p>
  </blockquote>
  <p>My Question is:</p>
  <ol>
  <li>What could be the probable reasons for this timeout failure?
  Note: As this is production DB server, we have thousands of multiple queries/transactions running concurrently so this CREATE INDEX.... will require a significant amount of time. But still, will this query throw timeout exception?</li>
  <li>Does Postgres throw statement timeout error for CREATE UNIQUE INDEX CONCURRENTLY? As this query requires multiple hours to finish for large tables.</li>
  <li>What could be the probable workaround for this?</li>
  </ol>