psycopg2/sandbox/test.py

13 lines
270 B
Python
Raw Normal View History

import datetime
import psycopg
#d = datetime.timedelta(12, 100, 9876)
#print d.days, d.seconds, d.microseconds
#print psycopg.adapt(d).getquoted()
o = psycopg.connect("dbname=test")
c = o.cursor()
c.execute("SELECT 1.0 AS foo")
print c.fetchmany(2)
print c.fetchall()