# How to Prune Old Messages and Blobs with PostgresSaver to Manage Database Size? Hi team, I have a question regarding the intended usage of PostgresSaver in LangGraph, specifically around managing the size of the checkpointing database when implementing st

**URL:** <https://forum.langchain.com/t/how-to-prune-old-messages-and-blobs-with-postgressaver-to-manage-database-size-hi-team-i-have-a-question-regarding-the-intended-usage-of-postgressaver-in-langgraph-specifically-around-managing-the-size-of-the-checkpointing-database-when-implementing-st/1598>\
**Category:** LangGraph\
**Tags:** self-hosted, python-help\
**Created:** [September 19, 2025, 4:42pm UTC](https://forum.langchain.com/t/how-to-prune-old-messages-and-blobs-with-postgressaver-to-manage-database-size-hi-team-i-have-a-question-regarding-the-intended-usage-of-postgressaver-in-langgraph-specifically-around-managing-the-size-of-the-checkpointing-database-when-implementing-st/1598 "2025-09-19T16:42:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwli0755](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pwli0755/32/1014_2.png) [@pwli0755](https://forum.langchain.com/u/pwli0755)\
**Post date:** [September 19, 2025, 4:42pm UTC](https://forum.langchain.com/t/how-to-prune-old-messages-and-blobs-with-postgressaver-to-manage-database-size-hi-team-i-have-a-question-regarding-the-intended-usage-of-postgressaver-in-langgraph-specifically-around-managing-the-size-of-the-checkpointing-database-when-implementing-st/1598/1 "2025-09-19T16:42:46Z")

</div>

I’m looking for a reliable method to permanently prune older parts of the state from my PostgreSQL database. This seems like a common requirement for long-running, stateful applications, and I would appreciate any official guidance or recommendations.

---

<div class="post-metadata">

**Author:** ![catherine-langchain](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@catherine-langchain](https://forum.langchain.com/u/catherine-langchain)\
**Post date:** [September 20, 2025, 12:21am UTC](https://forum.langchain.com/t/how-to-prune-old-messages-and-blobs-with-postgressaver-to-manage-database-size-hi-team-i-have-a-question-regarding-the-intended-usage-of-postgressaver-in-langgraph-specifically-around-managing-the-size-of-the-checkpointing-database-when-implementing-st/1598/2 "2025-09-20T00:21:03Z")

</div>

Hey @pwli0755 ! Is this a langgraph platform deployment?  
For existing memory, you would likely have to do that manually.  
For future deployments, you could look into setting up default TLL to your checkpoints! [How to add TTLs to your LangGraph application - Docs by LangChain](https://docs.langchain.com/langgraph-platform/configure-ttl#configuring-checkpoint-ttl)

---

<div class="post-metadata">

**Author:** ![arthurmarcal](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/arthurmarcal/32/246_2.png) [@arthurmarcal](https://forum.langchain.com/u/arthurmarcal)\
**Post date:** [December 19, 2025, 2:50pm UTC](https://forum.langchain.com/t/how-to-prune-old-messages-and-blobs-with-postgressaver-to-manage-database-size-hi-team-i-have-a-question-regarding-the-intended-usage-of-postgressaver-in-langgraph-specifically-around-managing-the-size-of-the-checkpointing-database-when-implementing-st/1598/3 "2025-12-19T14:50:57Z")

</div>

Thanks for pointing to the documentation, @catherine-langchain ! Just to confirm, the [TTL configuration](https://docs.langchain.com/langsmith/configure-ttl) you referenced is specifically for the LangSmith platform deployment, right?

In my case I’m running my own infrastructure with a Postgres checkpointer on AWS Aurora (using `langgraph-checkpoint-postgres`) for both LangGraph-based agents and deep-agents. Is there a **native TTL/retention configuration** supported for PostgresSaver in this self-hosted scenario as well, or would cleanup/pruning need to be implemented manually?

---

<div class="post-metadata">

**Author:** ![catherine-langchain](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@catherine-langchain](https://forum.langchain.com/u/catherine-langchain)\
**Post date:** [December 19, 2025, 6:47pm UTC](https://forum.langchain.com/t/how-to-prune-old-messages-and-blobs-with-postgressaver-to-manage-database-size-hi-team-i-have-a-question-regarding-the-intended-usage-of-postgressaver-in-langgraph-specifically-around-managing-the-size-of-the-checkpointing-database-when-implementing-st/1598/4 "2025-12-19T18:47:51Z")

</div>

Hey @arthurmarcal ! Yes, the TTL configuration is specifically for ls deployments, and I don’t believe we have similar support for oss / self hosted scenarios
