![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
how to use native C datatypes with the libpq api? I mean what are the native representation of timestamp, int, float etc. (all 'primitive' datatypes of postgresql) for the C language? I know that I may go through a string representation, but I fear I would sacrifice too much performance converting from/to string. Additionaly I know that the 'native' int4 is the network form of int4 (ie. hton(int)) What about all the other types? I found some in the example ... but there must be some documentation about it .. I found nothing! |
#2
| |||
| |||
|
|
Sascha Bohnenkamp <bohnenkamp (AT) mevisbreastcare (DOT) de> wrote: how to use native C datatypes with the libpq api? I mean what are the native representation of timestamp, int, float etc. (all 'primitive' datatypes of postgresql) for the C language? I know that I may go through a string representation, but I fear I would sacrifice too much performance converting from/to string. Additionaly I know that the 'native' int4 is the network form of int4 (ie. hton(int)) What about all the other types? I found some in the example ... but there must be some documentation about it .. I found nothing! I am afraid that the only documentation for this is the source code. Also, look at timestamps: During ./configuration, you can specify --enable-integer-datetimes or not, and the binary representation of a timestamp will depend on this setting. True, you could run 'SHOW integer_datetimes' and make your code depend on the output, but it seems like a lot of trouble. |
![]() |
| Thread Tools | |
| Display Modes | |
| |