INTERVAL parameter in PreparedStatement worked in 7.4 but not in 8.0 driver

Поиск
Список
Период
Сортировка
От Matt Magoffin
Тема INTERVAL parameter in PreparedStatement worked in 7.4 but not in 8.0 driver
Дата
Msg-id 50387.219.89.94.58.1130457365.squirrel@msqr.us
обсуждение исходный текст
Ответы Re: INTERVAL parameter in PreparedStatement worked in 7.4  ("Matt Magoffin" <postgresql.org@msqr.us>)
Re: INTERVAL parameter in PreparedStatement worked in 7.4  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Hello,

I used to use the following style statement with the 7.4 series JDBC driver:

select * from users users where users.createdDate < (CURRENT_DATE -
INTERVAL ?)

and would set the parameter to a string value of "14 DAYS"

but in the Postgres 8 driver, this query executes but does not seem to
ever return anything. Is there a better syntax I could use to make this
work?

The query does work in the 8 driver if the ? is explicitly part of the
query, i.e. not a positional parameter, like this:

select * from users users where users.createdDate < (CURRENT_DATE -
INTERVAL '14 DAYS')

Any help much appreciated,
m@

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: XADataSource interface
Следующее
От: "Matt Magoffin"
Дата:
Сообщение: Re: INTERVAL parameter in PreparedStatement worked in 7.4