The latest version of libpqxx, 1.2.2, introduces a new class
"CachedResult" that makes large result sets easier to handle by fetching
rows on-demand and caching them internally. I've added some tests for
this new feature, but the code is fairly complex and I'm sure it can be
broken in ways I haven't thought of.
Is anyone out there willing to give it a whirl? It's far from finished
now (it doesn't evict blocks yet if the cache gets too large, and there
are going to be some internal changes before I can implement iterators)
but I suspect this class may be fairly useful already.
Download it at
ftp://gborg.postgresql.org/pub/libpqxx/stable/libpqxx-1.2.2.tar.gz
Jeroen