OK, for the last six months I've been completely misunderstanding the PostgreSQL backend's memory allocation system. I tend to understand poorly documented systems by assuming they are well designed and filling in the pieces. When it turns out to be crap, I fall face down in it. I think I've got it and everything in my test frame seems to work, but do I trust myself yet? Can I now finish the work I've been rescheduling for the last six months? Outch. I'm completely wired and need to settle down.