Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all default times store in the DB with milliseconds down to 6point. #828

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

jwoertink
Copy link
Member

Fixes #727

This makes all Time columns store with milliseconds. The tough part is if you're trying to do exact comparison with time, it's a bit harder now, but the benefit is if you need to sort by a time column, you'll get a more accurate sorting. This is especially common with UUID based tables that sort by created_at.

Also to note that out of the box default with postgres seems to use this same format for time columns:

development=# select now();
              now              
-------------------------------
 2022-03-12 18:02:14.760713+00
(1 row)

@jkthorne
Copy link
Contributor

does this work with all the time datatypes in postgres?

@jwoertink
Copy link
Member Author

Probably not with the date field, but we only map Time to timestampz, so for now that's the only one I'm looking at. I think for the other date/time column types, you'd probably have to hand roll some custom stuff.

@jwoertink jwoertink merged commit b6d0d9c into main Mar 14, 2022
@jwoertink jwoertink deleted the issues/727-2 branch March 14, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time columns don't include milliseconds
3 participants