From 8288b1dcab97b793bbf70d32d38c1822f5cec0ce Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Mon, 18 Aug 2025 01:46:15 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"fix=20=20pg=5Fvector=20extension=20re?= =?UTF-8?q?quires=20SUPERUSER,=20but=20not=20availabl=E2=80=A6=20(#24108)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/configs/middleware/vdb/pgvector_config.py | 5 ----- api/core/rag/datasource/vdb/pgvector/pgvector.py | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/api/configs/middleware/vdb/pgvector_config.py b/api/configs/middleware/vdb/pgvector_config.py index a5d4c2e0d..9f5f7284d 100644 --- a/api/configs/middleware/vdb/pgvector_config.py +++ b/api/configs/middleware/vdb/pgvector_config.py @@ -9,11 +9,6 @@ class PGVectorConfig(BaseSettings): Configuration settings for PGVector (PostgreSQL with vector extension) """ - PGVECTOR_IS_OWNER: Optional[bool] = Field( - description="Whether the PGVector is the owner of the database", - default=True, - ) - PGVECTOR_HOST: Optional[str] = Field( description="Hostname or IP address of the PostgreSQL server with PGVector extension (e.g., 'localhost')", default=None, diff --git a/api/core/rag/datasource/vdb/pgvector/pgvector.py b/api/core/rag/datasource/vdb/pgvector/pgvector.py index 05e9979c3..746773da6 100644 --- a/api/core/rag/datasource/vdb/pgvector/pgvector.py +++ b/api/core/rag/datasource/vdb/pgvector/pgvector.py @@ -253,8 +253,7 @@ class PGVector(BaseVector): return with self._get_cursor() as cur: - if dify_config.PGVECTOR_IS_OWNER: - cur.execute("CREATE EXTENSION IF NOT EXISTS vector") + cur.execute("CREATE EXTENSION IF NOT EXISTS vector") cur.execute(SQL_CREATE_TABLE.format(table_name=self.table_name, dimension=dimension)) # PG hnsw index only support 2000 dimension or less # ref: https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing