Re: Problems with protocol V3 after migration to latest driver

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Problems with protocol V3 after migration to latest driver
Дата
Msg-id Pine.BSO.4.56.0410261227101.24411@leary.csoft.net
обсуждение исходный текст
Ответ на Re: Problems with protocol V3 after migration to latest driver  ("Alexey Yudichev" <Alexey@francoudi.com>)
Список pgsql-jdbc

On Tue, 26 Oct 2004, Alexey Yudichev wrote:

> Ah, except that thing with "at time zone":
>
> select now() at time zone ('-02:00'::interval);
> works OK in psql console;
>
> but with JDBC
> select now() at time zone (?::interval)
> with setString(1, '-02:00')

Right, setString was recently changed from typing things as text to
varchar.  This means you need (?::text::interval) now, at least for this
example on 7.4.  Another solution would be to use the PGobject type
PGInterval via something like:

SELECT now() AT TIME ZONE ?

setObject(1, new org.postgresql.util.PGInterval("-02:00"));

I actually forget if this will work at the moment, but if not it will
eventually because of a patch from Oliver Jowett.  This avoids the pg
specific cast in your sql code, but adds pg specific code at compile time.
I imagine it might be more future proof though.

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Problems with protocol V3 after migration to latest driver
Следующее
От: "Jason Tesser"
Дата:
Сообщение: using 8 bit ascii