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

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.checkpoint.postgresbaseSELECT_SQL
    Attribute●Since v1.0

    SELECT_SQL

    Copy
    SELECT_SQL = "\nselect\n    thread_id,\n    checkpoint,\n    checkpoint_ns,\n    checkpoint_id,\n    parent_checkpoint_id,\n    metadata,\n    (
      \n        select array_agg(array[bl.channel::bytea, bl.type::bytea, bl.blob])\n        from jsonb_each_text(checkpoint -> 'channel_versions')\n        inner join checkpoint_blobs bl\n            on bl.thread_id = checkpoints.thread_id\n            and bl.checkpoint_ns = checkpoints.checkpoint_ns\n            and bl.channel = jsonb_each_text.key\n            and bl.version = jsonb_each_text.value\n    ) as channel_values,\n    (\n        select\n        array_agg(array[cw.task_id::text::bytea, cw.channel::bytea, cw.type::bytea, cw.blob] order by cw.task_id,
      cw.idx)\n        from checkpoint_writes cw\n        where cw.thread_id = checkpoints.thread_id\n            and cw.checkpoint_ns = checkpoints.checkpoint_ns\n            and cw.checkpoint_id = checkpoints.checkpoint_id\n
    ) as pending_writes\nfrom checkpoints "
    View source on GitHub