Skip to content

Avoid redundant pgvector extension creation - #50

Merged
adamsitnik merged 7 commits into
CommunityToolkit:mainfrom
adamsitnik:copilot/fix-ensure-collection-exists-async
Aug 31, 2026
Merged

Avoid redundant pgvector extension creation#50
adamsitnik merged 7 commits into
CommunityToolkit:mainfrom
adamsitnik:copilot/fix-ensure-collection-exists-async

Conversation

@adamsitnik

Copy link
Copy Markdown
Contributor

fixes #49

Copilot AI and others added 7 commits August 31, 2026 11:44
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
@adamsitnik
adamsitnik requested review from roji and a lite review from Copilot August 31, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #49 by changing PgVector collection creation to avoid executing CREATE EXTENSION IF NOT EXISTS vector when the vector extension is already installed, enabling EnsureCollectionExistsAsync to succeed under roles that lack CREATE EXTENSION privileges.

Changes:

  • Split pgvector extension existence detection from extension creation to avoid privilege failures when the extension is preinstalled.
  • Added a helper (IsVectorExtensionInstalledAsync) to probe for extension presence, and refined exception handling for concurrent installs/insufficient privileges.
  • Bumped CommunityToolkit.VectorData.PgVector package version to 1.0.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
MEVD/src/PgVector/PostgresCollection.cs Avoids redundant extension creation by checking for vector first and only creating when absent.
MEVD/src/PgVector/PgVector.csproj Increments package version to reflect the behavioral fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread MEVD/src/PgVector/PostgresCollection.cs
@adamsitnik
adamsitnik merged commit 126f5ae into CommunityToolkit:main Aug 31, 2026
17 checks passed
@adamsitnik
adamsitnik deleted the copilot/fix-ensure-collection-exists-async branch August 31, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EnsureCollectionExists without extension create privileges

3 participants