--- src/interfaces/python/pgdb.py 2001-06-15 04:23:18.000000000 +0200 +++ /usr/lib/python2.1/site-packages/pgdb.py 2002-04-04 23:07:49.000000000 +0200 @@ -135,6 +135,13 @@ value = string.replace(value, "$", "") value = string.replace(value, ",", "") value = float(value) + elif typ == DATETIME_TIME: + hour, min, sec = value.split(':') + value = DateTime.DateTimeDelta(0, int(hour), + int(min), int(sec)) + elif typ == DATETIME_DATE: + year, mon, day = value.split('-') + value = DateTime.DateTime(int(year), int(mon), int(day)) elif typ == DATETIME: # format may differ ... we'll give string pass @@ -225,6 +232,10 @@ self.rowcount = totrows self.description = None + # name chose for compat with psycopg + def lastoid(self): + return self.__source.oidstatus() + def fetchone(self): res = self.fetchmany(1, 0) try: @@ -410,6 +421,8 @@ DATETIME = pgdbType( 'abstime', 'reltime', 'tinterval', 'date', 'time', 'timespan', 'timestamp' ) +DATETIME_TIME = pgdbType('time') +DATETIME_DATE = pgdbType('date') # OIDs are used for everything (types, tables, BLOBs, rows, ...). This may cause # confusion, but we are unable to find out what exactly is behind the OID (at