Re: Problem with datetime in updates

[email protected]
Newsgroups gmane.comp.gnu.enterprise.general
Message-ID <[email protected]>
Hello.

El lun, mar 29, a las 01:08:55 James Thompson escribía:
> 
> >
> >  id | nick | name |          created           | ...
> > ----+------+------+----------------------------+ ...
> >  11 | f    | ff   | 2004-03-29 01:23:22.886056 | ...
> > 					^^^^^^
> > status='prop'
> >
> > i.e.: no decimal digits for seconds, so none record gets updated.
> >
> > ¿Any suggestion about how can I deal with it?
> 
> Yes.  I've seen this as well and forgot this would impact SuSE installs.  It 
> seems that the pygresql returns timestamps as rounded strings.  Since 
> gnue-common cannot assume that the underlying database provides any type of 
> unique row id or a primary key it performs the update using the original 
> values retrieved in the where clause to find the correct row.  The rounded 
> string causes that match to fail on any table w/ a timestamp field.
> 
> The psycopg driver returns timestamps as DateTime objects which do not lose 
> precision so allow the update to work.  This is the solution I have used for 
> my production installs.
> 

I think I'm using psycopg, thought I suspect it's a somewhat old
version (1.0.8-1, in python2.1 from debian):

DB001: [GConnections:514] gnue.common.datasources.drivers.appserver is
not a dbdriver
DB005: [GConnections:494] trying module: adodbapi
DB005: [GConnections:494] trying module: adodbapi
DB005: [GConnections:494] trying module: db2
DB005: [GConnections:494] trying module: db2
DB005: [GConnections:494] trying module: informix
DB005: [GConnections:494] trying module: informix
DB005: [GConnections:494] trying module: mysql
DB005: [GConnections:494] trying module: mysql
DB005: [GConnections:494] trying module: postgresql
DB001: [GConnections:239] Using gnue.common.datasources.drivers.postgresql.psycopg as base driver for psycopg


and in connections.conf:

[gnue]
comment = GNUe Database
aliases = dcl test
provider = psycopg
host = localhost
dbname = gnue

thanks
-- 
José Esteban
Granada - Spain
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.