There is an issue in the file libs/checkpoint-postgres/langgraph/store/postgres/base.py at line 377. #312

Closed
opened 2026-02-20 17:36:03 -05:00 by yindo · 2 comments
Owner

Originally created by @1315577677 on GitHub (Nov 15, 2024).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph/LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph/LangChain rather than my code.
  • I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code

def __init__(self, conn):
        self.store = PostgresStore(conn)
        self.store.setup()

Error Message and Stack Trace (if applicable)

Traceback (most recent call last):
  File "D:\tools-plugin\tools_plugin\store\store.py", line 63, in get_store_by_type
    return PGStore(conn)
           ^^^^^^^^^^^^^
  File "D:\tools-plugin\tools_plugin\store\store.py", line 28, in __init__
    self.store.setup()
  File "D:\tools-plugin\env\Lib\site-packages\langgraph\store\postgres\base.py", line 377, in setup
    version = row["v"]
              ~~~^^^^^
TypeError: tuple indices must be integers or slices, not str

Description

version = row["v"] should be version = row[0]

System Info

..

Originally created by @1315577677 on GitHub (Nov 15, 2024). ### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the [LangGraph](https://langchain-ai.github.io/langgraph/)/LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangGraph/LangChain rather than my code. - [X] I am sure this is better as an issue [rather than a GitHub discussion](https://github.com/langchain-ai/langgraph/discussions/new/choose), since this is a LangGraph bug and not a design question. ### Example Code ```python def __init__(self, conn): self.store = PostgresStore(conn) self.store.setup() ``` ### Error Message and Stack Trace (if applicable) ```shell Traceback (most recent call last): File "D:\tools-plugin\tools_plugin\store\store.py", line 63, in get_store_by_type return PGStore(conn) ^^^^^^^^^^^^^ File "D:\tools-plugin\tools_plugin\store\store.py", line 28, in __init__ self.store.setup() File "D:\tools-plugin\env\Lib\site-packages\langgraph\store\postgres\base.py", line 377, in setup version = row["v"] ~~~^^^^^ TypeError: tuple indices must be integers or slices, not str ``` ### Description version = row["v"] should be version = row[0] ### System Info ..
yindo closed this issue 2026-02-20 17:36:04 -05:00
Author
Owner

@vbarda commented on GitHub (Nov 15, 2024):

@1315577677 You can solve this by passing row_factory=dict_row to the connection kwargs when creating the connection, like here https://github.com/langchain-ai/langgraph/blob/main/libs/checkpoint-postgres/langgraph/store/postgres/base.py#L359

let me know if that addresses your issue!

in the meantime, we'll look into automatically adding this for all operations by default

@vbarda commented on GitHub (Nov 15, 2024): @1315577677 You can solve this by passing `row_factory=dict_row` to the connection kwargs when creating the connection, like here https://github.com/langchain-ai/langgraph/blob/main/libs/checkpoint-postgres/langgraph/store/postgres/base.py#L359 let me know if that addresses your issue! in the meantime, we'll look into automatically adding this for all operations by default
Author
Owner

@1315577677 commented on GitHub (Nov 17, 2024):

@vbarda got it, thx

@1315577677 commented on GitHub (Nov 17, 2024): @vbarda got it, thx
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#312