summaryrefslogtreecommitdiff
path: root/sandbox/stress.py
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/stress.py')
-rw-r--r--sandbox/stress.py19
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']