Dave Cramer <pg@fastcrypt.com> writes:
> On 6-Nov-05, at 9:01 AM, William Harris wrote:
>> intervalStmt = con.prepareStatement( "select current_date +
>> (interval ?)" );
The above is not and never has been correct syntax; the fact that it
failed to fail in previous JDBC versions was accidental. The syntax
interval 'literal'
(or in general any type name followed by a string literal) is defined
to work only for literals. The correct way to do this is either
CAST(? AS interval) (SQL standard)
?::interval (Postgres-ism)
See
http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-CONSTANTS
particularly the note at the end of section 4.1.2.5.
Fraid you're out of luck on the SET example though :-(
regards, tom lane