On Mon, 5 Dec 2005, Michael Paesold wrote:
> Hi,
>
> I am running postgresql-8.1-404.jdbc3.jar against server version 7.4.7, which
> I want to eventually upgrade to 8.1.
>
> String DELETE_QUERY = "DELETE FROM server_log WHERE level_value"
> + " <= ? AND event_time < NOW() - interval ?";
>
The syntax "interval ?" may not be used in prepared queries. This is a
limitation of the backend which you can see using PREPARE/EXECUTE at the
SQL level. The 8.0 driver started using true prepared queries instead of
directly interpolating parameter values and issuing a regular sql
statement. You must use "CAST(? AS INTERVAL)" or "?::interval".
Kris Jurka