title: Update a column of a table with a column of another table in PostgreSQL
body: <p>I want to copy all the values from one column <code>val1</code> of a table <code>table1</code> to one column <code>val2</code> of another table <code>table2</code>. I tried this command in PostgreSQL:</p>
  
  <pre><code>update table2
  set val2 = (select val1 from table1)
  </code></pre>
  
  <p>But I got this error:</p>
  
  <blockquote>
  <pre><code>ERROR:  more than one row returned by a subquery used as an expression
  </code></pre>
  </blockquote>
  
  <p>Is there an alternative to do that?</p>