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