For nothing, you are welcome.
It's enough.
Ok, lets say out table name is MyTable and table is partitioned by column eventTime(just for example):
dbadmin=> select eventTime from MyTable order by eventTime desc;
eventTime
----------------------------
2018-01-01 00:56:12.734092 // year 2018, newest timestamp
...
2017-08-12 00:58:53.244886
2017-08-11 00:56:12.734092
2017-08-10 00:56:12.734092
2017-08-09 00:56:12.734092 // year 2017, oldest timestamp
(366 rows)
so an oldest partition is:
dbadmin=> select to_char(min(eventTime), 'MMDD')::INT from MyTable;
to_char
---------
809
(1 row)
P.S.
Assumption: data <= 1 year.
P. P.S.
Say me if you need a help to write a Bash or Python script.