title: Psycopg2: how to insert and update on conflict using psycopg2 with python?
body: <p>I am using psycopg2 to insert command to postgres database and when there is a confilict i just want to update the other column values.</p>
  
  <p>Here is the query:</p>
  
  <pre><code>        insert_sql = '''
          INSERT INTO tablename (col1, col2, col3,col4)
          VALUES (%s, %s, %s, %s) (val1,val2,val3,val4)
          ON CONFLICT (col1)
          DO UPDATE SET
          (col2, col3, col4)
          = (val2, val3, val4) ; '''
  
          cur.excecute(insert_sql)
  </code></pre>
  
  <p>I want to find where I am doing wrong? I am using variables val1 , val2, val3 not actual values.</p>