> > Therefore, I wonder about closing the connection and resetting the status > > when OOM_result is retunred, by callling pqDropConnection() as > > handleFatalError() does. > > In this case, the connection status should also be set to CONNECTINO_BAD.
There are many code paths in libpq that can trigger an out-of-memory error. However, this patch makes libpq drop the connection when OOM_result is returned, which likely covers only a subset of those cases. So I'm not sure dropping the connection only for OOM_result would meaningfully improve things. Perhaps it would be more consistent to drop the connection for any internal libpq error such as out-of-memory, though that might require invasive code changes and coul break existing applications, I'm afraid. Regards, -- Fujii Masao
