Query data : PostgreSQL : Database PYTHON TUTORIALS


PYTHON TUTORIALS » Database » PostgreSQL »

 

Query data


import pgdb
cxn = pgdb.connect(user='pgsql')
cur = cxn.cursor()
cur.execute('SELECT * FROM pg_database')
rows = cur.fetchall()
for i in rows:
  print i
cur.close()
cxn.commit()
cxn.close()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Database
» PostgreSQL