Re: OCTET_LENGTH is wrong

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: OCTET_LENGTH is wrong
Дата
Msg-id 3BFAB470.3020906@tm.ee
обсуждение исходный текст
Ответ на Re: OCTET_LENGTH is wrong  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

Thomas Lockhart wrote:

>>>There have been three ideas of what octet_length() sould return:
>>>      1) compressed on-disk storage length
>>>      2) byte length in server-side encoding
>>>      3) byte length in client-side encoding
>>>
>...
>
>>>The open question is whether we should be doing #3.
>>>
>
>There is no question in my mind that (3) must be the result of
>octet_length(). Any of the other options may give an interesting result,
>but of no practical use to a client trying to retrieve data.
>
What practical use does #3 give ;) do you really envision a program that 
does 2
separate queries to retrieve some string, first to query its storage 
length and then
to actually read it, instead of just reading it ?

I don't think we evan have a interface in any of our libs where we can 
give a
pre-allocated buffer to a client library to fill in. Or do we ?

>And everything is a client!
>
So in a PL/PgSQL function doing some data manipulation through SPI the 
"client" is
who - the server or the client or some third party ?

---------------
Hannu



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: SPI and CommandCounterIncrement, redux
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: OCTET_LENGTH is wrong