0

我的申请遇到了一些问题。它适用于我的开发环境,但不适用于我的客户服务器..

带有时间戳的 generate_series 不起作用。相同的功能,但整数工作。

错误信息:

 [Request processing failed; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query] with root cause
    org.postgresql.util.PSQLException: ERROR: function generate_series(unknown, unknown, interval) does not exist
      Hint: No function matches the given name and argument types. You might need to add explicit type casts.

我在 PostgreSQL 中找不到该函数。我在哪里可以获得这些方法的副本,以便在可能的情况下安装它们。

4

2 回答 2

2

你没有提到你的 PostgreSQL 版本,但是

generate_series(timestamp, timestamp, interval)

在 8.4 之前不可用

那么也许您使用的是过时的版本?

于 2012-04-03T13:01:54.203 回答
1

您必须将timestamp值作为前两个函数参数传递。或投射它们:

generate_series('2011-12-31'::timestamp, '2012-12-31'::timestamp, '1 day')
于 2012-04-03T13:00:43.063 回答