Question about how to handle numeric (decimal) data types while using libpq - Mailing list pgsql-general

From Sudheer H R
Subject Question about how to handle numeric (decimal) data types while using libpq
Date
Msg-id 63A4A360-8A41-476B-A5B6-D00088D6F590@tekenlight.com
Whole thread Raw
Responses Re: Question about how to handle numeric (decimal) data types while using libpq  (Dmitry Igrishin <dmitigr@gmail.com>)
Re: Question about how to handle numeric (decimal) data types while using libpq  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-general
Hello,

I am trying to use libpq for interfacing with PostgreSQL from a C/C++ based application.

I have tried to use binary format of data for both sending and receiving data to and from server (resultFormat = 1).

As I understand most binary types, int, float etc… are encoded in bing-endian byte order and they can be converted to
appropriatehost specific memory representations. 

However NUMERIC datatype is a more complex structure with multiple ints and pointers.

I would like to know if there are published library functions that convert (to and from) NUMERIC field to say, long
doubledatatype 


Any pointers in this regard is appreciated.

Regards,
Sudheer





pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: When to REINDEX a serial key?
Next
From: Dmitry Igrishin
Date:
Subject: Re: Question about how to handle numeric (decimal) data types while using libpq