2

I would like to be able to explicitly remove a partition (and its data).

It would be nice if I could say: "remove the oldest table", but assuming this is not available, I'm ready to compromise on which exact partition I want to remove.

I know I can just execute drop table EVENTS_p2015_07_16 but I'm wondering if it ain't going to mess up anything with partman data and configuration.

Is there another way to do that?

danieln
  • 4,795
  • 10
  • 42
  • 64
  • Have you looked at [the documentation about Retention options](http://pgxn.org/dist/pg_partman/doc/pg_partman.html#Retention)? You should be able to set the number of partitions you want to keep, then execute the `run_maintenance()` function to automatically drop (or archive) the old data. – IMSoP Jul 16 '15 at 13:34
  • 1
    Yes I have read it, thanks, but it doesn't help me. I'd like to identify when my DB is taking too much disk space and in such cases to remove data (and do it by efficiently removing a partition). – danieln Jul 19 '15 at 06:46

0 Answers0