# Space management in PostgreSQL deployments

**URL:** <https://community.temporal.io/t/space-management-in-postgresql-deployments/3222>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [October 22, 2021, 4:22pm UTC](https://community.temporal.io/t/space-management-in-postgresql-deployments/3222 "2021-10-22T16:22:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Grinchenko](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/paul_grinchenko/32/96_2.png) [@Paul\_Grinchenko](https://community.temporal.io/u/Paul_Grinchenko)\
**Post date:** [October 22, 2021, 4:22pm UTC](https://community.temporal.io/t/space-management-in-postgresql-deployments/3222/1 "2021-10-22T16:22:44Z")

</div>

Hey,

What is the best recommended way to purge really old workflows from our PostgresSQL deployment?  
I glanced through documentation and didn’t find concrete recommendation. Sorry if I missed something obvious

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [October 23, 2021, 5:30pm UTC](https://community.temporal.io/t/space-management-in-postgresql-deployments/3222/2 "2021-10-23T17:30:20Z")

</div>

Every namespace has a retention period configuration. This defines how long _completed_ workflows stay in DB before being automatically cleaned up.

```auto
> tctl -ns default namespace describe
Name: default
...
Retention: 24h0m0s
...

```

The retention period can be updated. The current limitation is that the new retention period applies only to newly completed workflows, so it is not going proactively to clean up workflows that closed before the update. We are working on fixing this.
