import psycopgdbh = psycopg.connect('dbname=dbname user=userName')print "Connection successful."cur = dbh.cursor()cur.execute("SELECT * FROM myTable")cur.arraysize = 2while 1: rows = cur.fetchmany() print "Obtained %d results from fetchmany()." % len(rows) if not len(rows): break for row in rows: print row dbh.close()
Name (required)
email (will not be published) (required)
Website