【发布时间】:2020-10-26 09:00:17
【问题描述】:
我收到一个错误
Caused by: org.postgresql.util.PSQLException: ERROR: function months_between(timestamp with time zone, timestamp without time zone) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 310
我已经找到这个错误的原因是因为参数不匹配=>(timestamp without time zone, timestamp without time zone)
TRUNC(MONTHS_BETWEEN (date_trunc('day', now()), people.original_date_of_hire) / 12) masa_bekerja_year, ");
那么,如何将这个语法参数与这个正确的参数匹配=>(没有时区的时间戳,没有时区的时间戳)?我需要与此匹配,因为我的框架使用这种参数格式并且我不允许更改框架。
【问题讨论】:
-
postgres中没有MONTHS_BETWEEN函数Doc
-
它的自定义函数是我们在 postgre 模式中创建的作为框架的函数,正如我所说的,我想将参数与之匹配
标签: java postgresql hibernate