Type conversion. What do I do with a PostgreSQL OID value in libpq in C?
I'm working with the PostgreSQL C API, libpq. I need to be able to convert the values in a PGresult* into their equivalent data types in Ruby. I'm currently just selecting all the data and using PQgetvalue() , which gives me a char* that I can convert into a ruby String. That's easy. But are there any examples somebody can share that do a type conversion from the char* to, say, int , float or double , according to the OID returned by PQftype() ? Actually, in short I have no idea how to interpret the OID and the documentation doesn't seem to give any pointers. I found this page , but that doesn