# Data retention?

**URL:** <https://community.cratedb.com/t/data-retention/298>\
**Category:** CrateDB\
**Created:** [November 5, 2019, 10:41am UTC](https://community.cratedb.com/t/data-retention/298 "2019-11-05T10:41:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [October 28, 2022, 3:38pm UTC](https://community.cratedb.com/t/data-retention/298/3 "2022-10-28T15:38:43Z")

</div>

Hi, partitioning by a generated column using `date_trunc` was already possible in version 3, but for downsampling you would probably be looking at using `date_bin` which was introduced in 4.7 so upgrading would be best if that is an option for you.  
Take a look at [Resampling time-series data with DATE\_BIN - Tutorials - CrateDB Community](https://community.cratedb.com/t/resampling-time-series-data-with-date-bin/1009)  
and [CrateDB and Apache Airflow: Implementation of a Data Retention Policy - Tutorials - CrateDB Community](https://community.cratedb.com/t/cratedb-and-apache-airflow-implementation-of-a-data-retention-policy/913).

---

_[View the full topic](https://community.cratedb.com/t/data-retention/298)._
