title: How to insert array items into PostgreSQL table
body: <p>Give an array like this:  </p>
  
  <pre><code>my_array = [2,3,5,23,4]
  </code></pre>
  
  <p>and a table like this:</p>
  
  <pre><code> column1 | column2 
  ---------+----------
     1     |     
     2     |     
     3     |     
     4     |     
     5     | 
  </code></pre>
  
  <p>How can I insert the array values into a table. Roughly I want to do something like this with SQL:</p>
  
  <pre><code>for item in my_array:
   UPDATE my_table SET colum2 = item
  </code></pre>
  
  <p>The updated table should be like this</p>
  
  <pre><code> column1 | column2 
  ---------+----------
     1     |     2 
     2     |     3 
     3     |     5 
     4     |     23 
     5     |     4 
  </code></pre>
  
  <p>UPDATE: 
  I am using Python psycopg2 but I am wondering if there is a way with pure SQL.</p>