Changeset 845
- Timestamp:
- 03/13/07 12:31:49 (2 years ago)
- Files:
-
- pg8000/trunk/pg8000.py (modified) (2 diffs)
- pg8000/trunk/pg8000_test.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pg8000/trunk/pg8000.py
r842 r845 1497 1497 return datetime.datetime(year, month, day, hour, minute, int(sec), int((sec - int(sec)) * 1000000)) 1498 1498 1499 def timestamp_out(v, **kwargs): 1500 return v.isoformat(' ') 1501 1499 1502 def numeric_in(data, **kwargs): 1500 1503 if data.find(".") == -1: … … 1557 1560 decimal.Decimal: {"tid": 1700, "txt_out": numeric_out}, 1558 1561 Bytea: {"tid": 17, "bin_out": byteasend}, 1562 datetime.datetime: {"tid": 1114, "txt_out": timestamp_out}, 1559 1563 type(None): {"tid": -1}, 1560 1564 } pg8000/trunk/pg8000_test.py
r843 r845 330 330 "retrieved value match failed") 331 331 332 def TestTimestampRoundtrip(self): 333 v = datetime.datetime(2001, 2, 3, 4, 5, 6, 170000) 334 db.execute("SELECT $1 as f1", v) 335 retval = tuple(db.iterate_dict()) 336 self.assert_(retval == ({"f1": v},), 337 "retrieved value match failed") 338 332 339 def TestOidIn(self): 333 340 db.execute("SELECT oid FROM pg_type")
