Changeset 827
- Timestamp:
- 03/10/07 00:21:37 (2 years ago)
- Files:
-
- pg8000/trunk/pg8000.py (modified) (2 diffs)
- pg8000/trunk/pg8000-test.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pg8000/trunk/pg8000.py
r825 r827 1207 1207 return float(data) 1208 1208 1209 def float8send(v, **kwargs): 1210 return struct.pack("!d", v) 1211 1209 1212 # The timestamp_recv function is sadly not in use because some PostgreSQL 1210 1213 # servers are compiled with HAVE_INT64_TIMESTAMP, and some are not. This … … 1278 1281 str: {"tid": 25, "txt_out": textout}, 1279 1282 unicode: {"tid": 25, "txt_out": textout}, 1283 float: {"tid": 701, "bin_out": float8send}, 1284 decimal.Decimal: {"tid": 1700, "txt_out": numeric_out}, 1280 1285 type(None): {"tid": -1}, 1281 1286 } pg8000/trunk/pg8000-test.py
r824 r827 7 7 import pg8000 8 8 9 db = pg8000.Connection(host='joy', user='pg8000-test', database='pg8000-test', password='pg8000-test', socket_timeout=5)9 #db = pg8000.Connection(host='joy', user='pg8000-test', database='pg8000-test', password='pg8000-test', socket_timeout=5) 10 10 #db = pg8000.Connection(host='localhost', user='mfenniak') 11 #db = pg8000.Connection(user="mfenniak", unix_sock="/tmp/.s.PGSQL.5432")11 db = pg8000.Connection(user="mfenniak", unix_sock="/tmp/.s.PGSQL.5432") 12 12 13 13 print "testing db.execute and error recovery in NoData query" … … 81 81 assert tuple(cur1.iterate_dict()) == ({"?column?": 5},) 82 82 83 cur1.execute("SELECT $1", 22.333) 84 retval = tuple(cur1.iterate_dict()) 85 assert retval == ({"?column?": 22.332999999999998},) 86 87 cur1.execute("SELECT $1", decimal.Decimal("22.333")) 88 retval = tuple(cur1.iterate_dict()) 89 assert retval == ({"?column?": decimal.Decimal("22.333")},) 90 83 91 cur1.execute("SELECT 5000::smallint") 84 92 assert tuple(cur1.iterate_dict()) == ({"int2": 5000},)
