title: Type error when attempting to insert dict values into postgresql table
body: <p>I am having trouble inserting multiple values into a postgres table with python's psycopg2 executemany() function.  I have a dict with the following values:</p>
  
  <pre><code>{u'city': u'14000', u'sitename': u'12298', u'longitude': u'-9767764.18643674', u'county': u'17031', u'sourceid': u'42', u'state': u'17', u'latitude': u'5147311.10876352', u'csrfmiddlewaretoken': u'WY7EBHl55TuWSwXv4C3vNa5X5d0peJyv', u'sourcesiteid': u'42'  }
  </code></pre>
  
  <p>which I am attempting to insert with the following code:</p>
  
  <pre><code>try:
      con = psycopg2.connect(db_connect)
      cur = con.cursor()
  
      cur.executemany("""INSERT INTO cacw_sites(sourceid,sitename,sourcesiteid,state,county,city,schooldistrict,zipcode,neighborhood,latitude,longitude) 
                         VALUES ( %(sourceid)s, %(sitename)s, %(sourcesiteid)s, %(state)s, %(county)s, %(city)s, %(zipcode)s, %(neighborhood)s, 
                                  %(latitude)s, %(longitude)s)""", dict)
      con.commit()
  except psycopg2.DatabaseError, e:
      print 'There was a problem updating the sites: %s'%e
  
  finally:
      if con:
          con.close()
  </code></pre>
  
  <p>However, I keep receiving the error: <strong>TypeError: string indices must be integers</strong></p>
  
  <p>I realize that I am somehow trying to reference a string with another string but I am not sure  where.  If I do</p>
  
  <pre><code>dict['state']
  </code></pre>
  
  <p>I recieve the proper output of </p>
  
  <pre><code>u'17'
  </code></pre>
  
  <p>So how come I cannot seem  to insert these values correctly?
  Thank you for your help!</p>