LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    Chat LangChain

    What can I help with?

    Enter to send·Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.checkpoint.postgresbasePRUNE_CHECKPOINTS_SQL
    Attribute●Since v3.2

    PRUNE_CHECKPOINTS_SQL

    Copy
    PRUNE_CHECKPOINTS_SQL = "\nWITH deleted AS (
      \n    DELETE FROM checkpoints\n    WHERE thread_id = %s AND checkpoint_ns = %s AND checkpoint_id <> ALL(%s)\n    RETURNING checkpoint -> 'channel_versions' AS versions\n)\nSELECT DISTINCT v.key AS channel, v.value AS version\nFROM deleted\nCROSS JOIN LATERAL jsonb_each_text(deleted.versions
    ) AS v\n"
    View source on GitHub