[GH-ISSUE #465] DOC: Postgres Schema for LangGraph Checkpointer #54

Open
opened 2026-02-17 17:19:05 -05:00 by yindo · 2 comments
Owner

Originally created by @Farhana-Asgar6 on GitHub (Aug 19, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/465

Issue with current documentation:

https://github.com/langchain-ai/langgraph/blob/main/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py

schema created when using Langgraph Checkpointer with postgres.
setup() function in class AsyncPostgresSaver

Idea or request for content:

I am looking for documentation that explains the schema created when using the LangGraph checkpointer with Postgres. Currently, I have not been able to find any references in the docs. Could you please add or point me to documentation that outlines the tables and schema details?

This would be very helpful for understanding and exploring LangGraph further.

Originally created by @Farhana-Asgar6 on GitHub (Aug 19, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/465 ### Issue with current documentation: https://github.com/langchain-ai/langgraph/blob/main/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py schema created when using Langgraph Checkpointer with postgres. setup() function in class AsyncPostgresSaver ### Idea or request for content: I am looking for documentation that explains the schema created when using the LangGraph checkpointer with Postgres. Currently, I have not been able to find any references in the docs. Could you please add or point me to documentation that outlines the tables and schema details? This would be very helpful for understanding and exploring LangGraph further.
yindo added the langgraphexternal labels 2026-02-17 17:19:05 -05:00
Author
Owner

@punith300i commented on GitHub (Aug 26, 2025):

LangGraph's PostgreSQL checkpointer by default saves the checkpointer tables into the public schema of a PostgreSQL DB. The checkpointer under the hood uses psycopg3 for handling connections to the PostgreSQL DB.

To use a different db schema, we can leverage the psycopg3 db connection options to add a search_path option as mentioned in PostgreSQL search_path docs.

options="-c search_path=<custom schema name>,public"

Example:
we could include a custom schema to checkpointer by adding this options to the DB URI.

postgresql://<user_name>:<pwd>@<host>:<port>/<db_name>?options=-csearch_path%3D<custom schema name>,public
@punith300i commented on GitHub (Aug 26, 2025): LangGraph's PostgreSQL [checkpointer](https://github.com/langchain-ai/langgraph/tree/main/libs/checkpoint-postgres) by `default` saves the checkpointer tables into the `public` schema of a PostgreSQL DB. The checkpointer under the hood uses `psycopg3` for handling connections to the PostgreSQL DB. To use a different db schema, we can leverage the psycopg3 db connection [options](https://www.psycopg.org/psycopg3/docs/api/objects.html#psycopg.ConnectionInfo.options) to add a `search_path` option as mentioned in [PostgreSQL search_path docs](https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH). ``` options="-c search_path=<custom schema name>,public" ``` Example: we could include a custom schema to checkpointer by adding this options to the DB URI. ``` postgresql://<user_name>:<pwd>@<host>:<port>/<db_name>?options=-csearch_path%3D<custom schema name>,public ```
Author
Owner

@code2tan commented on GitHub (Sep 2, 2025):

use AsyncConnectionPool class

    # 创建异步连接池
    async_connection_pool = AsyncConnectionPool[AsyncConnection[dict[str, Any]]](
        conninfo=db.get_db_conn_url(),
        max_size=20,
        kwargs={
            "autocommit": True,
            "prepare_threshold": 0,
            "row_factory": dict_row,
        },
    )

    # 创建异步 PostgreSQL 保存器
    checkpointer = AsyncPostgresSaver(conn=async_connection_pool, serde=JsonOnlySerializer())

get_db_conn_url() return :

postgresql://<user_name>:<pwd>@<host>:<port>/<db_name>?options=-csearch_path%3D<custom schema name>,public

JsonOnlySerializer optional setting, you can use:

checkpointer = AsyncPostgresSaver(conn=async_connection_pool)
@code2tan commented on GitHub (Sep 2, 2025): use AsyncConnectionPool class ```python # 创建异步连接池 async_connection_pool = AsyncConnectionPool[AsyncConnection[dict[str, Any]]]( conninfo=db.get_db_conn_url(), max_size=20, kwargs={ "autocommit": True, "prepare_threshold": 0, "row_factory": dict_row, }, ) # 创建异步 PostgreSQL 保存器 checkpointer = AsyncPostgresSaver(conn=async_connection_pool, serde=JsonOnlySerializer()) ``` get_db_conn_url() return : ``` postgresql://<user_name>:<pwd>@<host>:<port>/<db_name>?options=-csearch_path%3D<custom schema name>,public ``` JsonOnlySerializer optional setting, you can use: ```python checkpointer = AsyncPostgresSaver(conn=async_connection_pool) ```
yindo changed title from DOC: Postgres Schema for LangGraph Checkpointer to [GH-ISSUE #465] DOC: Postgres Schema for LangGraph Checkpointer 2026-06-05 17:24:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#54