title: passing numeric where parameter condition in postgress using python
body: <p>I am trying to use postgresql in Python.The query is against a numeric field value in the where condition. The result set is not fetching and giving error ("psycopg2.ProgrammingError: no results to fetch").There are records in the database with agent_id (integer field) > 1. </p>
  
  <pre><code>import psycopg2
  # Try to connect
  try:
      conn=psycopg2.connect("dbname='postgres' host ='localhost')
  except:
    print "Error connect to the database."
  
  cur = conn.cursor()
  agentid = 10000
  
  try:
      sql = 'SELECT * from agent where agent_id &gt; %s::integer;'
      data = agentid
      cur.execute(sql,data)
  except: 
       print "Select error"
  
  rows = cur.fetchall()
  print "\nRows: \n"`
  for row in rows:``
      print "   ", row[9] 
  </code></pre>