Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

setting PreparedStatement parameter using "at time zone interval ?"



I'm using the latest 8.3 development driver against an 8.3 database. I
thought back in 8.1 I used to be able to use a PreparedStatement that
included something like

... date(l.created AT TIME ZONE INTERVAL ?)

but now I am always getting an exception like

org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1"

I found if I changed the query to use this syntax:

... date(timezone(?::interval, l.created))

it worked fine. Should the former syntax be supported by the JDBC driver?

-- m@



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group