Repository navigation
✨ feat: add PGVECTOR_CREATE_EXTENSION env to support managed Postgres - #284
Merged
Merged
Conversation
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Plumbs a create_extension parameter through get_vector_store into ExtendedPgVector/AsyncPgVector so callers can opt out of the CREATE EXTENSION IF NOT EXISTS vector call that langchain's PGVector runs on __post_init__.
danny-avila
force-pushed
the
claude/wizardly-kapitsa-630382
branch
from
April 23, 2026 16:09
f30b680 to
d9b4f77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PGVECTOR_CREATE_EXTENSIONenv var (defaultTrue— back-compatible) that, when set toFalse, skips theCREATE EXTENSION IF NOT EXISTS vectorcall langchain'sPGVectorruns on startup.create_extensionargument throughget_vector_storeintoExtendedPgVector/AsyncPgVector.Fixes a startup crash on managed Postgres (RDS, Azure Database for PostgreSQL, Cloud SQL, etc.) where the application user is not a superuser but the
vectorextension has already been pre-installed out-of-band. Without this flag, the container loops onpsycopg2.errors.InsufficientPrivilege: permission denied to create extension "vector".Closes #275, closes #99.
Test plan
tests/services/test_vector_store_factory.py— addedtest_get_vector_store_defaults_create_extension_trueandtest_get_vector_store_propagates_create_extension_falsecovering both sync and async modes.PGVECTOR_CREATE_EXTENSION=Falseagainst a Postgres instance where the app user is not a superuser andvectoris pre-installed — container should start cleanly.🤖 Generated with Claude Code