lpsmith/postgresql-simple — Issue #11: Use a cursor to implement fold
Author: lpsmith
Created: 2012-01-17 21:45:11+00:00
State: open

A database cursor is probably a better way to implement the fold function than what is currently being used. Doing so would solve all the current issues hinted at in the commit notes for bce0d389fd16a35a88841bb8434fab264b824993.

If the user-supplied function throws an exception, a straightforward cursor-based implementation of fold would avoid leaving libpq in an unusable state for that connection, although we should still close the cursor when this happens to free up resources on the database server.