繁体   English   中英

generate_series()函数缺少PostgreSQL

[英]generate_series() function missing PostgreSQL

我的应用程序遇到了麻烦。 它可以在我的开发环境中工作,但不能在我的客户服务器上工作。

带时间戳的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中找不到该函数。 在哪里可以获得这些方法的副本,以便在可能的情况下安装它们。

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

generate_series(timestamp, timestamp, interval)

在8.4之前不可用

因此,也许您使用的是过时的版本?

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

generate_series('2011-12-31'::timestamp, '2012-12-31'::timestamp, '1 day')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM