Changeset 810
- Timestamp:
- 03/08/07 17:27:03 (2 years ago)
- Files:
-
- pg8000/trunk/pg8000.py (modified) (2 diffs)
- pg8000/trunk/pg8000-test.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pg8000/trunk/pg8000.py
r809 r810 635 635 while 1: 636 636 msg = self._read_message() 637 print repr(msg)638 637 if isinstance(msg, Protocol.ParseComplete): 639 638 # ok, good. … … 671 670 # get back from this statement. Now we can Bind values. 672 671 output_fc = [Types.py_type_info(f) for f in row_desc.fields] 673 print repr(output_fc)674 672 self._send(Protocol.Bind(portal, statement, param_fc, params, output_fc, self._client_encoding)) 675 print "bind" 673 # I don't know why we need to send DescribePortal again, but without it, 674 # we don't receive our BindComplete. It's like Flush fails to work. 675 self._send(Protocol.DescribePortal(portal)) 676 676 self._send(Protocol.Flush()) 677 print "flush"678 677 while 1: 679 678 msg = self._read_message() 680 print repr(msg)681 679 if isinstance(msg, Protocol.BindComplete): 682 680 # good news everybody! 683 #return row_desc684 681 pass 682 elif isinstance(msg, Protocol.RowDescription): 683 # Return the new row desc, since it will have the format 684 # types we asked for 685 return msg 685 686 elif isinstance(msg, Protocol.ErrorResponse): 686 687 raise msg.createException() pg8000/trunk/pg8000-test.py
r809 r810 6 6 import pg8000 7 7 8 db = pg8000.Connection(host='joy.fenniak.net', user='Mathieu Fenniak', database="software", password="hello", socket_timeout=5) 8 #db = pg8000.Connection(host='joy.fenniak.net', user='Mathieu Fenniak', database="software", password="hello", socket_timeout=5) 9 db = pg8000.Connection(host='localhost', user='mfenniak') 9 10 db.iterate_dicts = True 10 11 … … 32 33 print "Beginning type checks..." 33 34 35 cur1.execute("SELECT $1", 5) 36 assert tuple(cur1) == ({"?column?": 5},) 37 34 38 cur1.execute("SELECT 5000::smallint") 35 39 assert tuple(cur1) == ({"int2": 5000},) … … 45 49 46 50 cur1.execute("SELECT 1.1::real") 47 assert tuple(cur1) == ({"float4": 1.1000000 000000001},)51 assert tuple(cur1) == ({"float4": 1.1000000238418579},) 48 52 49 53 cur1.execute("SELECT 1.1::double precision")
