[PR #239] [CLOSED] fix: PGVector --> PGVectorStore: migration fails for a custom db schema #255

Closed
opened 2026-02-16 05:17:07 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langchain-postgres/pull/239
Author: @NisugaJ
Created: 8/1/2025
Status: Closed

Base: mainHead: main


📝 Commits (10+)

  • cd3c6f4 get the table in the specified schema of the vector store
  • 60aa42e docstring and concat
  • f41f74a DEFAULT_SCHEMA
  • e707727 Revert "DEFAULT_SCHEMA"
  • f278b80 Revert "get the table in the specified schema of the vector store"
  • 84b4a8c Add async method to create database schema for PGVectorStore
  • 7289666 Refactor table name handling to include schema in PGVectorStore tests
  • b736ec1 Refactor table name handling to ensure schema is included in vector store tests
  • fec4163 Simplify schema creation method documentation and remove duplicate error handling
  • 21333d9 Improve validation for schema name in _ainit_database_schema method

📊 Changes

2 files changed (+105 additions, -53 deletions)

View changed files

📝 langchain_postgres/v2/engine.py (+21 -0)
📝 tests/unit_tests/v2/test_pg_vectorstore.py (+84 -53)

📄 Description

The internal __amigrate_pgvector_collection fails to select the table if the new table is in a custom db schema.

This fix will help who wants to upgrade (to v0.0.14+) .

Also, I have added DEFAULT_SCHEMA to test_pg_vectorstore.py.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langchain-postgres/pull/239 **Author:** [@NisugaJ](https://github.com/NisugaJ) **Created:** 8/1/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`cd3c6f4`](https://github.com/langchain-ai/langchain-postgres/commit/cd3c6f412a44424a4af9bc921fc4d0fb36e4f3a6) get the table in the specified schema of the vector store - [`60aa42e`](https://github.com/langchain-ai/langchain-postgres/commit/60aa42edcdab9f780982419a627635af27553712) docstring and concat - [`f41f74a`](https://github.com/langchain-ai/langchain-postgres/commit/f41f74aa57b55752ad7b28f6be75d65cc38dab0c) DEFAULT_SCHEMA - [`e707727`](https://github.com/langchain-ai/langchain-postgres/commit/e707727974cf2912d5e14567cd1279cf4fc82a02) Revert "DEFAULT_SCHEMA" - [`f278b80`](https://github.com/langchain-ai/langchain-postgres/commit/f278b807a50251bd104d0b9bf9ffa7b60826b7ac) Revert "get the table in the specified schema of the vector store" - [`84b4a8c`](https://github.com/langchain-ai/langchain-postgres/commit/84b4a8ceab5dc57091299db190b0fe8ece02f510) Add async method to create database schema for PGVectorStore - [`7289666`](https://github.com/langchain-ai/langchain-postgres/commit/7289666674146267efe86b3368ca670d5ce4fdc1) Refactor table name handling to include schema in PGVectorStore tests - [`b736ec1`](https://github.com/langchain-ai/langchain-postgres/commit/b736ec1e4eddb8519a5775f36021f943bdd4de93) Refactor table name handling to ensure schema is included in vector store tests - [`fec4163`](https://github.com/langchain-ai/langchain-postgres/commit/fec41632564eb73c9d19965ed6a7679713fc56f4) Simplify schema creation method documentation and remove duplicate error handling - [`21333d9`](https://github.com/langchain-ai/langchain-postgres/commit/21333d95388baa1f86d2f431d9beb4ca2152500b) Improve validation for schema name in _ainit_database_schema method ### 📊 Changes **2 files changed** (+105 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `langchain_postgres/v2/engine.py` (+21 -0) 📝 `tests/unit_tests/v2/test_pg_vectorstore.py` (+84 -53) </details> ### 📄 Description The internal `__amigrate_pgvector_collection` fails to select the table if the new table is in a custom db schema. This fix will help who wants to upgrade (to `v0.0.14+`) . Also, I have added DEFAULT_SCHEMA to `test_pg_vectorstore.py`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 05:17:07 -05:00
yindo closed this issue 2026-02-16 05:17:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#255