SOCI library describes binding for std::tm to work with timestamps. std::tm structure precision is second, but PostgreSQL timestamp provides better precision. Can you advise the optimal way to access timestamps with less than second precision?
I tried unsigned long and long long data types for accessing timestamps but without success. The only way I succeeded is string, but this will require parsing it (I would like to have some conventional value to work with - like, long in milliseconds or even better c++11 time_point), which is far from optimal.
Thanks in advance.
If you're communicating with PostgreSQL via
libpq
, uselibpqtypes
. It'll help with managing PostgreSQL data types.If you're not using
libpq
, details please.