Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. import psycopg2
  2. conn = psycopg2.connect(dbname=dbn, user=dbuser, password=dbpas, host=dbhost)
  3. cursor = conn.cursor()
  4. cursor.execute(“SELECT * FROM list_oid”)
  5. row = cursor.fetchone()
  6. for row in cursor:
  7. print(row.decode('utf8'))
  8. cursor.close()
  9. conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement