title: python Psycopg delete not working
body: <p>The code is below. It returns "DELETE 1" when there is a record to delete and "DELETE 0" when there isn't. But it doesn't actually delete the record when there is one there. The exact same SQL (with <code>%s</code> replaced with <code>tournament_id</code>) pasted into pgAdmin III deletes the record. I'm at the wood/trees stage. Any ideas?</p>
  
  <pre><code>def deletePlayers(tournamentId):
      # takes tournamentId and deletes all records from tournament_player 
      # with that tournamentId 
      # but not an error if no records to delete
  
      # check tournamentId set if not return
      if tournamentId &lt; 1:
          returnStr = "ERROR - tournamentId not set"
          return returnStr
  
      DB = connect()
      cur = DB.cursor()
  
      # delete data
      SQL = "DELETE from tournament_player where tournament_id = %s;"
      data = (tournamentId,)
      cur.execute(SQL, data )
      returnStr = cur.statusmessage
      DB.commit
      # tidy up
      cur.close
      DB.close
  
      return returnStr
  </code></pre>