Find answers from the community

Updated 10 months ago

Hi there, we're now using PGVectorStore

Hi there, we're now using PGVectorStore and we're seeing that there's a lot of open connections to the postgres db. Do we need to close the connections somehow, has anyone every run into this issue?
L
k
8 comments
I think I've seen warning about it, but tbh I haven't dove into it yet lol
Not 100% sure how/where its happening
since all the db connections are scoped
Plain Text
with self._session() as session, session.begin():
    ...
interesting, I'll have a look it might be some of our custom code πŸ˜„
but good to know that you dont specifically have to close it.
Yea from my understanding, the with ... statement should be closing it

Similair to how with open("file.txt", 'r') as f: will close the file for you
(but clearly with the warnings being printed, it's maybe not happening somewhere lol)
Add a reply
Sign up and join the conversation on Discord