【发布时间】:2026-01-15 23:10:01
【问题描述】:
我有一个查询可以在 Postgresql 7.4 上运行,但不能在具有相同数据库的 Postgresql 8.3 上运行。
查询:
SELECT * FROM login_session WHERE (now()-modified) > timeout;
得到以下错误:
ERROR: operator does not exist: interval > integer
LINE 1: ...ELECT * FROM login_session WHERE (now()-modified) > timeout ...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
列modified 是timestamp,timeout 是integer。
我需要在服务器上更改一些设置吗?
我正在新服务器 (ubuntu) 上为客户端安装应用程序,因此我无法更改应用程序中的查询。
【问题讨论】:
标签: sql postgresql