【发布时间】:2023-02-10 17:21:29
【问题描述】:
Postgres 不支持低于 1 微秒的时间戳精度。建议的解决方案是store timestamp across two separate fields: one with timestamp up to second precision and separately nanoseconds。我的问题是如何在 Spring Boot 中实现它,以便我仍然可以拥有纳秒级精度的字段。如何将字段存入数据库时一分为二,如何基于两列正确的hydrate对象中的字段?
我目前使用的是 Spring Boot 2.5.14、Java 11 或 Kotlin 1.6(具体取决于项目)和 Postgres 14.4。如果有需要升级的解决方案,我们可能可以做到,无论如何都计划升级。
【问题讨论】:
标签: spring postgresql spring-boot hibernate spring-data-jpa