Re: getColumnDisplayWidth() returns 0x7fffffff for char varying

Поиск
Список
Период
Сортировка
От Dan Evans
Тема Re: getColumnDisplayWidth() returns 0x7fffffff for char varying
Дата
Msg-id 4A2D2301.60703@invores.com
обсуждение исходный текст
Ответ на Re: getColumnDisplayWidth() returns 0x7fffffff for char varying  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Oliver Jowett wrote:
> Dan Evans wrote:
>
>> My problem is that getColumnDisplayWidth() returns the widths
>>
>> column(1) uname(2147483647)
>
> This has been discussed at some length previously, check the list archives.
>
> (quick summary from memory: for an unbounded character varying type,
> there's nothing really sensible we can return - that column could have a
> gigabyte of text for all we know. We originally returned -1 but that
> broke some common RowSet implementations. Now we return Integer.MAX_VALUE)
>
> -O
>

I did check the archives before posting, but the hits on getColumnDisplayWidth() did not seem relevant.  If you can
pointto the approximate date, I'd appreciate it. 

For any ResultSet that is completely contained in the address space of the requestor, the return value can be the
maximumlength of the values for the requested column in the result set.  If the ResultSet is not complete in the
requestor'saddress space at the time of the getColumnDisplayWidth() call, that might be the time to return
Integer.MAX_VALUEsignifying no useful information.  Most ResultSet's are reasonably small, so I would hope that doesn't
happenoften.  But even then, some useful information can be provided to the caller.  The maximum length across the
receivedrows can be returned, with a negative value indicating that this is only an estimate based on the received
rows.However, if negative values break some implementations, then that is precluded. 

Dan

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: getColumnDisplayWidth() returns 0x7fffffff for char varying
Следующее
От: Gaël BOUGANNE
Дата:
Сообщение: Getting views' metadata