Reputation: 3344
I'm currently using grails with classes storing java.util.Date fields als DATETIME. However I need the precision / milliseconds to be stored as well which I think is not possible with MySQL.
If I switch to PostgreSQL, will it store my Dates with millisecond precision (or is it easy to configure it this way)?
Upvotes: 0
Views: 848
Reputation: 11
Yes, since MySql 5.6.4 you can use DATETIME(3) for milliseconds, or DATETIME(6) for microseconds
TIME and other types also now support precision.
http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html
Upvotes: 1
Reputation: 127486
Yes, Hibernate / PostgreSQL can also store milisecond precision, no problem. Use the Hibernate timestamp datatype.
Upvotes: 1