I've fixed some memory leaks in db_postgres.nim. I had a long running service that kept running out of memory, and I noticed several Postgres processes were at their maintenance_work_mem at the same time (I think this is because of single-row mode).
The pull request has just been merged: https://github.com/nim-lang/Nim/pull/20940
If you have this problem, the commit has just been merged into nim-devel!
Jason