eudoxia0 / crane

An ORM for Common Lisp.
http://eudoxia.me/crane/
201 stars 19 forks source link

Postgres: Timestamps are modified when saving other fields. #38

Open wnortje opened 9 years ago

wnortje commented 9 years ago

When a timestamp field gets a value during record creation it also contains the microseconds

2015-09-23 13:28:49.562436

If the record is then read from the db via (single) and another field is changed and then the record is saved again, the timestamp field now contains this

2015-09-23 13:28:49

without the microseconds.

eudoxia0 commented 8 years ago

I suppose this is a precision mismatch between local-time and Postgres. Is there a Postgres option for specifying the precision of timestamps?

wnortje commented 8 years ago

There may be a precision mismatch but I don't think that is what is causing the problem here. I think it is a conversion problem. Both the values I mention above are extracted from the table at different times.

The first value is created by local-time and stored in the DB. The change in accuracy happens when that records is read from the DB, modified and then saved

intertricity commented 6 years ago

I'm not entirely sure if this will help, but the postmodern site seemed to make a particular point about timestamps so I thought I'd relay it here- I was looking around for ORM's and this one looked really nice.

https://github.com/marijnh/Postmodern#caveats-and-to-dos