Re: Problem with datetime in updates
James Thompson <[email protected]>
| Newsgroups | gmane.comp.gnu.enterprise.general |
|---|---|
| Message-ID | <[email protected]> |
> > 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 just did a quick look over the python dbsig api docs and didn't see a way to specify return type. Maybe someone here knows another way to get what we need from the python driver. Take Care, James