pgDynamicPartitions is a script that allows you to maintain a rolling window of daily table partitions under PostgreSQL. When called daily via cron, it will create x empty partitions into the future and keep only n partitions from the past 30 days, for example, and drop any that are older. It can be used with multiple tables, and each can be treated differently by calling it with different parameters via cron.