attached is a new version of the patch series. Aside from fixing various issues (crashes, memory leaks). The patches are rebased to current master, and I also attach a few SQL scripts I used for testing (nothing fancy, just stress-testing all the parts the patch touches).
Hi Tomas,
I get cascading conflicts in pg_proc.h. It looked easy enough to fix, except then I get compiler errors: