title: Confirmation that a postgres 'update' query worked in python
body: <p>I've written my first 'update' query in python, while it seems correct, I'm not sure how to receive back the output to confirm it worked..</p>
  
  <p>This is supposed to load a CSV file and replace the values in the first column with those in the second:</p>
  
  <pre><code>def main():
      try:
          conn=psycopg2.connect("dbname='subs' user='subs' host='localhost' password=''")
      except:
          print "I am unable to connect to the database."
          sys.exit()
  
      with open("dne.txt", "r+") as f:
          for line in f:
              old = line.split(',')[0].strip()
              new = line.split(',')[1].strip()
              cur = conn.cursor()
              cur.execute("UPDATE master_list SET subs = '{0}' WHERE subs = '{1}';".format(new, old))
              conn.commit()
              results = cur.fetchall()
              for each in results:
                  print str(each)
  
  
  if __name__=="__main__":
      main()
  </code></pre>
  
  <p>I thought the results (UPDATE 1 for each change?) would come back as a tuple, but I got an error instead:</p>
  
  <pre><code>psycopg2.ProgrammingError: no results to fetch
  </code></pre>
  
  <p>I'm not sure if this means my query just didn't work and there were no updates, or if I can't use fetchall() like I'm trying to.</p>
  
  <p>Any feedback or suggestions welcome!</p>