mirror of
https://github.com/langchain-ai/langchain-postgres.git
synced 2026-07-16 01:33:18 -04:00
Does PGVector really need SQLAlchemy URLs? If so, why not psycopg3? #76
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @khteh on GitHub (Jun 1, 2025).
When I use
postgresqlscheme, I hit this error:(1) Why
psycopg2instead ofpsycopg3(https://www.psycopg.org/psycopg3/docs/basic/install.html)?(2) Does it actually need SQLAlchemy URLs since it is
PGVector? Why not directly using thepostgresqlscheme?@averikitsch commented on GitHub (Jul 2, 2025):
Hi @khteh can you provide the code snippet you are trying to run? Thanks!
@khteh commented on GitHub (Jul 3, 2025):
https://github.com/khteh/rag-agent/blob/master/src/Infrastructure/VectorStore.py
@averikitsch commented on GitHub (Jul 10, 2025):
I am unable to reproduce the issue. What version of the library are you using?
@khteh commented on GitHub (Jul 11, 2025):
You need to modify the code to use
config.POSTGRESQL_DATABASE_URIto reproduce it.@averikitsch commented on GitHub (Jul 11, 2025):
Your URI is incorrect. Please update to use
postgresql+psycopg://. More info can be found https://github.com/langchain-ai/langchain-postgres/blob/main/examples/vectorstore.ipynb.@khteh commented on GitHub (Jul 11, 2025):
Isn't this back to square one? Can you please read the title of this issue again!?!
@averikitsch commented on GitHub (Jul 28, 2025):
@khteh
Yes, you need a SQLAlchemy URL since the underlying package relies on SQLAlchemy.
postgresql+psycopg://uses pscyopg3.