在时间戳postgress中搜索类似日期时出错

时间:2016-06-27 05:59:09

标签: postgresql jqgrid

我在postgres数据库中的timestamp变量中从jqGrid搜索日期。 从网格我发送搜索选项'op' - 'like'和searchtype为'string'。

我得到了以下的堆栈跟踪。

Caused by: org.postgresql.util.PSQLException: ERROR: function lower(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: 359
 at     org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102) ~[postgresql-9.1-901.jdbc4.jar:na]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835) ~[postgresql-9.1-901.jdbc4.jar:na]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) ~[postgresql-9.1-901.jdbc4.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500) ~[postgresql-9.1-901.jdbc4.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388) ~[postgresql-9.1-901.jdbc4.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273) ~[postgresql-9.1-901.jdbc4.jar:na]
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
at org.hibernate.loader.Loader.getResultSet(Loader.java:1953) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:802) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2542) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
... 72 common frames omitted

1 个答案:

答案 0 :(得分:0)

lower(text)使文字无效。你不能把时间戳作为。请改为lower(timestamptz_column::text)或使用to_char获取特定格式