Hi postgres lovers!
I just integrated a great improvement for postgres from Sam Marshall which makes recordsets on postgres do what they are supposed to (fetch the results in chunks, instead of all at once).
One concern is that the solution makes use of cursors using the option "WITH HOLD". This is specifically not supported with pgbouncer when configured to use transaction pooling (session pooling is fine).
We are considering backporting this - please comment on https://tracker.moodle.org/browse/MDL-60915 if you are using pgbouncer and tell us if you are using transaction or session pooling so we can have more information before we decide about the backport.