You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.
Example Code
frompsycopgimportConnectionfromlanggraph.store.postgresimportPostgresStoreconn_str=f"postgresql://{POSTGRES_USER}:{POSTGRES_PASSWD}@{IP_ADDRESS}:{PORT}/{MEMSTORE_DB}"conn=Connection.connect(conn_str)
pg_store=PostgresStore(conn=conn)
pg_store.setup()
# Store and retrieve datapg_store.put(("users", "123"), "prefs", {"theme": "dark"})
item=pg_store.get(("users", "123"), "prefs")
Error Message and Stack Trace (if applicable)
ActiveSqlTransaction Traceback (most recent call last)
Cell In[1], line 17
13 from langgraph.store.postgres import PostgresStore
15 pg_store = PostgresStore(conn=conn)
---> 17 pg_store.setup()
19 # Store and retrieve data
20 pg_store.put(("users", "123"), "prefs", {"theme": "dark"})File ~/Downloads/Code/venv/lib/python3.11/site-packages/langgraph/store/postgres/base.py:867, in PostgresStore.setup(self)865 version = _get_version(cur, table="store_migrations")866 for v, sql in enumerate(self.MIGRATIONS[version + 1 :], start=version + 1):-->867 cur.execute(sql)868 cur.execute("INSERT INTO store_migrations (v) VALUES (%s)", (v,))
870 if self.index_config:
File ~/Downloads/Code/venv/lib/python3.11/site-packages/psycopg/cursor.py:97, in Cursor.execute(self, query, params, prepare, binary)
93 self._conn.wait(
94 self._execute_gen(query, params, prepare=prepare, binary=binary)
95 )
96 except e._NO_TRACEBACK as ex:
---> 97 raise ex.with_traceback(None)
98 return self
ActiveSqlTransaction: CREATE INDEX CONCURRENTLY cannot run inside a transaction block
Description
I am trying to connect to postgresql as a MemoryStore using langgraph store postgres
The connection is established using psycopg - PostgresStore is not taking in the connection string
However, when I am trying to run the .setup() it is showing the error
ActiveSqlTransaction Traceback (most recent call last)
Cell In[1], line 17
13 from langgraph.store.postgres import PostgresStore
15 pg_store = PostgresStore(conn=conn)
---> 17 pg_store.setup()
19 # Store and retrieve data
20 pg_store.put(("users", "123"), "prefs", {"theme": "dark"})
File ~/Downloads/Code/venv/lib/python3.11/site-packages/langgraph/store/postgres/base.py:867, in PostgresStore.setup(self)
865 version = _get_version(cur, table="store_migrations")
866 for v, sql in enumerate(self.MIGRATIONS[version + 1 :], start=version + 1):
--> 867 cur.execute(sql)
868 cur.execute("INSERT INTO store_migrations (v) VALUES (%s)", (v,))
870 if self.index_config:
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
I am trying to connect to postgresql as a MemoryStore using langgraph store postgres
The connection is established using psycopg - PostgresStore is not taking in the connection string
However, when I am trying to run the .setup() it is showing the error
ActiveSqlTransaction Traceback (most recent call last)
Cell In[1], line 17
13 from langgraph.store.postgres import PostgresStore
15 pg_store = PostgresStore(conn=conn)
---> 17 pg_store.setup()
19 # Store and retrieve data
20 pg_store.put(("users", "123"), "prefs", {"theme": "dark"})
File ~/Downloads/Code/venv/lib/python3.11/site-packages/langgraph/store/postgres/base.py:867, in PostgresStore.setup(self)
865 version = _get_version(cur, table="store_migrations")
866 for v, sql in enumerate(self.MIGRATIONS[version + 1 :], start=version + 1):
--> 867 cur.execute(sql)
868 cur.execute("INSERT INTO store_migrations (v) VALUES (%s)", (v,))
870 if self.index_config:
File ~/Downloads/Code/venv/lib/python3.11/site-packages/psycopg/cursor.py:97, in Cursor.execute(self, query, params, prepare, binary)
93 self._conn.wait(
94 self._execute_gen(query, params, prepare=prepare, binary=binary)
95 )
96 except e._NO_TRACEBACK as ex:
---> 97 raise ex.with_traceback(None)
98 return self
ActiveSqlTransaction: CREATE INDEX CONCURRENTLY cannot run inside a transaction block
Python 3.11
langgraph==0.2.60
langgraph-checkpoint==2.0.9
langgraph-checkpoint-postgres==2.0.9
langgraph-sdk==0.1.48
psycopg==3.2.3
psycopg-c==3.2.3
langchain==0.3.13
langchain-chroma==0.1.4
langchain-community==0.3.7
langchain-core==0.3.28
langchain-experimental==0.3.3
langchain-google-genai==2.0.5
langchain-google-vertexai==2.0.7
langchain-openai==0.2.9
langchain-text-splitters==0.3.4
langchainhub==0.1.15
System Info
Output of "python -m langchain_core.sys_info"
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: