jaytaylor / django-pg-current-timestamp

Add true postgresql `CURRENT_TIMESTAMP` support to Django + PostgreSQL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

should use clock_timestamp instead of current_timestamp

tdumont60 opened this issue · comments

According to the Postgres docs CURRENT_TIMESTAMP returns the time at the start of the transaction, whereas CLOCK_TIMESTAMP returns the actual current timestamp. I believe the latter is what you want in this case, since you want to capture the timestamp when you call save() instead of an arbitrary time earlier in your request when the transaction was implicitly started.

@tdumont60 Thanks for the info. I'd happily merge a PR for this and release an update to Pypi.