Re: Inserting Information in PostgreSQL interval

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Inserting Information in PostgreSQL interval
Дата
Msg-id 4A3ECC37.5080000@opencloud.com
обсуждение исходный текст
Ответ на Inserting Information in PostgreSQL interval  (BlackMage <dsd7872@uncw.edu>)
Список pgsql-jdbc
BlackMage wrote:

> query.setObject(1, "{28.1, 29.2}");

> org.postgresql.util.PSQLException: ERROR: column "field_1" is of type
> interval[] but expression is of type character varying

The two-argument form of setObject() infers a type of Types.VARCHAR for
a java.lang.String (see the JDBC spec)

> So is there another way of entering an array of intervals into a postgresql
> database using prepared statement? What am I doing wrong?

Try:

  query.setObject(1, "{28.1, 29.2}", Types.OTHER);

-O

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

Предыдущее
От: BlackMage
Дата:
Сообщение: Inserting Information in PostgreSQL interval
Следующее
От: BlackMage
Дата:
Сообщение: Re: Inserting Information in PostgreSQL interval