Re: libpq binary transfer of the numeric data type - II

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq binary transfer of the numeric data type - II
Дата
Msg-id 16572.1091489720@sss.pgh.pa.us
обсуждение исходный текст
Ответ на libpq binary transfer of the numeric data type - II  (Brijesh Shrivastav <Bshrivastav@esri.com>)
Список pgsql-interfaces
Brijesh Shrivastav <Bshrivastav@esri.com> writes:
> Has anyone had success with fetching numeric data in binary format?
> I tried to follow Tom's advice below and try to reverse engineer from 
> recv/send function. It seemes the end structure that user will 
> get is of Numeric type (see struct below)

No, it isn't.  What you get is a series of int16 fields:
pq_sendint(&buf, x.ndigits, sizeof(int16));pq_sendint(&buf, x.weight, sizeof(int16));pq_sendint(&buf, x.sign,
sizeof(int16));pq_sendint(&buf,x.dscale, sizeof(int16));for (i = 0; i < x.ndigits; i++)    pq_sendint(&buf,
x.digits[i],sizeof(NumericDigit));
 

Note that the "digits" are base-10000 digits.
        regards, tom lane


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

Предыдущее
От: Brijesh Shrivastav
Дата:
Сообщение: libpq binary transfer of the numeric data type - II
Следующее
От: Brijesh Shrivastav
Дата:
Сообщение: Re: libpq binary transfer of the numeric data type -