So, I have finally complete this auto-pruning solution. It has proven effective in keeping the size of the db under whichever threshold I set in an unattended fashion.
I have one final question. If my goal is to maximize the amount of historical data that we can keep - e.g. set the db size limit to be as large as possible - how much disk space should I reserve for standard Postgres operations - e.g. sort space, WAL, etc.. I'm sure this depends a bit on our configuration, etc.. but if someone can point me in the direction as to what factors I should consider, I'd greatly appreciate it.
Thanks,
Mark