PostgreSQL SELECT : "unexpected: Downlink disconnected"

I don’t know about the error specifically, but more generally …

Can you explain (again probably, sorry) what you are trying to do with the data when you download it all? In my mind, sorting is for display in which case you can probably use some variant of ORDER BY, and updating fields can also often be done in the SQL itself rather than loading 26k rows, processing them then re-saving them all.

I can probably help with the SQL, but I’m not quite clear in my head what you’re trying to do.