I'm making a comparison between libpq and ODBC protocol.
It seems that in libpq, PGresult points to a structure that contains an entire resultset generated by an sql query (a snapshot of real data). To navigate through the data in the resultset I have to use PQgetvalue().
Given this, in PGresult there are disconncted data or not? When I call PQgetvalue() there's some kind of query to retrieve physical data from the real data source, or the real data is entirely available in the PGresult structure?
This point is very important cause sometimes queries can return large amount of data and storing them entirely in client memory in a PGresult instance could be a performance issue...isn't it?
ODBC protocol offers more features in this way. It is possibile to select a static block of data (like PGresult seems to be), or it is also possibile to select a more dynamic result set, that contains only keys to retrieve real data in the data source.