title: psycopg2 use dict+dict or dict+variable for binding variables into insert query
body: <p>I have dict and variable outside of query. I use interpolation for 
  binding variables like this:</p>
  
  <pre><code>self.cur.execute("""
      INSERT INTO
          items (sku, external_id, url, price, in_stock, title, created_at)
      VALUES
          (%(sku)s, %(external_id)s, %(url)s,  %(price)s, %(in_stock)s, %(title)s, now()) RETURNING id
      """, item)
  </code></pre>
  
  <p>Now I want to add additional field to query which is not in the object, but variable calculated before, like this:</p>
  
  <pre><code>retailer_id = self.retailer_ids[item.name] # &lt;- here we go!
  self.cur.execute("""
      INSERT INTO
          items (sku, external_id, url, price, in_stock, title, created_at, retailer_id)
      VALUES
          (%(sku)s, %(external_id)s, %(url)s,  %(price)s, %(in_stock)s, %(title)s, now(), %s) RETURNING id
      """, (item, retailer_id,))
  </code></pre>
  
  <p>But it doesn't work. I've tried many approaches but none of them are working.</p>
  
  <p>So I decided to workaround, convert my object into dict and add retailer_id to it manually, like this:</p>
  
  <pre><code>retailer_id = self.retailer_ids[item.name]
  item_dict = dict(item)
  item_dict['retailer_id'] = retailer_id
  try:
      self.cur.execute("""
          INSERT INTO
              items (sku, external_id, url, price, in_stock, title, created_at, retailer_id)
          VALUES
              (%(sku)s, %(external_id)s, %(url)s,  %(price)s, %(in_stock)s, %(title)s, now(), %(retailer_id)s) RETURNING id
          """, item_dict)
  </code></pre>
  
  <p>And obviously, it was working.</p>
  
  <p>Now I'm curious, is it possible to compose query using dict+variable or two dicts.</p>