title: Psygopg2 replacing multiple columns with python lists of tuples
body: <p>I am new to PostgreSQl. I am using Psycopg2 with PostgreSQL 9.5.6. My update SQL looks like this right now. I want to update multiple columns with a Python list of tuples using Psycopg2.</p>
  
  <pre><code>update_sql = '''
              UPDATE my_table
              SET size = n, mean = m, std_pop = std
              FROM unnest(%s) s(my_id integer, n integer, m double precision, std double precision)
              WHERE my_table.id = s.my_id;
          '''
  </code></pre>
  
  <p>For example, I have the following Python list of tuples (id, new_size, new_mean, new_std) in python:</p>
  
  <pre><code>new_column_values =[(0,10,9.0,8.0),(1,10,9.0,8.0),(2,10,9.0,8.0)]
  </code></pre>
  
  <p>which I want to put into the table and update all 3 columns at the same time:</p>
  
  <pre><code>+----+------+------+---------+
  | id | size | mean | std_pop |
  +----+------+------+---------+
  |  0 |    0 |    0 |       0 |
  |  1 |    0 |    0 |       0 |
  |  2 |    0 |    0 |       0 |
  +----+------+------+---------+
  </code></pre>
  
  <p>Would this be best way to update multiple columns? Right now it returns an error:</p>
  
  <pre><code>psycopg2.ProgrammingError: function return row and query-specified return row do not match
  DETAIL:  Returned type numeric at ordinal position 3, but query expects double precision.
  </code></pre>
  
  <p>It's saying it expects double precision, but got numeric type, which I don't know how to solve. My <strong>mean</strong> and <strong>std_pop</strong> columns are double precision columns. What's going on here?</p>