|
From: Andrew M. <an...@ob...> - 2005-05-20 01:51:44
|
In the current CVS HEAD, columns of type "time" are being returned as
DateTime objects, rather than Time objects (DateTimeDelta):
Welcome to psql 7.4.7, the PostgreSQL interactive terminal.
test=# create table x ( y time, z time with time zone);
CREATE TABLE
test=# insert into x values (now(), now());
INSERT 10352072 1
test=# select * from x;
y | z
-----------------+--------------------
11:46:25.602349 | 11:46:25.602349+10
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
>>> from pyPgSQL import PgSQL
>>> db=PgSQL.connect(database="test")
>>> c=db.cursor()
>>> c.execute('select * from x')
>>> c.fetchone()
[<DateTime object for '2005-05-20 21:46:25.60' at b7e7b950>, <DateTime object for '2005-05-20 11:46:25.60' at b7e88db0>]
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
|