簡體   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