title: Updating postgreSQL column with EXTRACT function (More than one row returned by a subquery used as an expression)
body: <p>Using PostgreSQL 9.1 table, I want to update day column with  extracting day number from timestamp column.</p>
  
  <pre>
  table:
  
  id|name|timesatmp
  -----------------
  </pre>
  
  <p>I created a day column then tried to extract the day number following:</p>
  
  <pre><code>SELECT EXTRACT(DAY FROM TIMESTAMP '2001-02-16 20:38:40');
  Result: 16
  </code></pre>
  
  <p><a href="http://www.postgresql.org/docs/current/static/functions-datetime.html" rel="nofollow">http://www.postgresql.org/docs/current/static/functions-datetime.html</a></p>
  
  <p>When i tried to update table using:</p>
  
  <pre><code>UPDATE table SET day = 
  ( SELECT EXTRACT (DAY FROM "timestamp") FROM table);
  </code></pre>
  
  <p>I got this error:</p>
  
  <pre><code>More than one row returned by a subquery used as an expression
  </code></pre>
  
  <p>I've found that i can repair my statement by adding <code>LIMIT 1</code> to the subquery to ensure that at most 1 row is returned. but still not sure if it's the right thing to do.</p>