Re: Question about how to handle numeric (decimal) data types while using libpq

2021-07-06 Thread Peter Eisentraut
On 06.07.21 13:04, Sudheer H R wrote: 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

Re: Question about how to handle numeric (decimal) data types while using libpq

2021-07-06 Thread Sudheer H R
It is not possible to use binary for some fields and text for some fields. If text format has to be used, it will be applicable for all fields. And this method involved converting to string format (sprint) on the server side and binary format from string (equivalent of sscanf), which is costly.

Re: Question about how to handle numeric (decimal) data types while using libpq

2021-07-06 Thread Dmitry Igrishin
On Tue, Jul 6, 2021, 14:04 Sudheer H R wrote: > 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

Question about how to handle numeric (decimal) data types while using libpq

2021-07-06 Thread Sudheer H R
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