diff options
author | Federico Di Gregorio <fog@initd.org> | 2004-10-19 03:17:12 +0000 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2004-10-19 03:17:12 +0000 |
commit | c904d97f696a665958c2cc43333d09c0e6357577 (patch) | |
tree | de88cb1cb6a48230f79bc0b532835d26a33660e9 /sandbox/stress.py | |
download | psycopg2-c904d97f696a665958c2cc43333d09c0e6357577.tar.gz |
Initial psycopg 2 import after SVN crash.
Diffstat (limited to 'sandbox/stress.py')
-rw-r--r-- | sandbox/stress.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sandbox/stress.py b/sandbox/stress.py new file mode 100644 index 0000000..bb31800 --- /dev/null +++ b/sandbox/stress.py @@ -0,0 +1,19 @@ +import psycopg +import psycopg.extras + +conn = psycopg.connect('dbname=test') +#curs = conn.cursor() +#curs.execute("CREATE TABLE itest (n int4)") + +#for i in xrange(10000000): +# curs = conn.cursor() +# curs.execute("INSERT INTO itest VALUES (1)") +# curs.execute("SELECT '2003-12-12 10:00:00'::timestamp AS foo") +# curs.execute("SELECT 'xxx' AS foo") +# curs.fetchall() +# curs.close() + +curs = conn.cursor(factory=psycopg.extras.DictCursor) +curs.execute("select 1 as foo") +x = curs.fetchone() +print x['foo'] |