I think more attention should be given to the libpq side of this patch; maybe have a 0001 with only the new libpq function, to easily verify that it does all it needs to do. It needs docs for the new function in libpq.sgml; also I wonder if checking conn->status before reporting values is necessary; finally, has the application any good way to check that the values can be safely read after calling the new function?
Nit: the new libpq function name is not great with all those lowercase letters. Better to make it camelCase like the rest of the libpq API? Thanks for the patch, -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services