Re: The same prepared query yield "-1" the first six times and then "-1.0"

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: The same prepared query yield "-1" the first six times and then "-1.0"
Дата
Msg-id CAKFQuwZzVWzxpcbeJsS2ZSBCi1j310B+N=5v-9roObQaq2dVEQ@mail.gmail.com
обсуждение исходный текст
Ответ на The same prepared query yield "-1" the first six times and then "-1.0"  (Edoardo Panfili <edoardo.panfili@iisgubbio.edu.it>)
Ответы Re: The same prepared query yield "-1" the first six times and then "-1.0"
Re: The same prepared query yield "-1" the first six times and then "-1.0"
Список pgsql-general

On Mon, Aug 21, 2023 at 8:28 AM Edoardo Panfili <edoardo.panfili@iisgubbio.edu.it> wrote:

   dim1 real DEFAULT '-1' NOT NULL

     System.out.print("p: "+rs.getString("dim1")+"\n”);

Can I do something to avoid this problem?

Use the type appropriate getter, not getString, to retrieve the value of the underlying real typed column.

Otherwise, I agree this seems like a bug, probably in the JDBC driver, though one pertains to style as opposed to semantics since both answers are technically correct.

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: The same prepared query yield "-1" the first six times and then "-1.0"
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?