Skip to content

Commit 8288b1d

Browse files
authored
Revert "fix pg_vector extension requires SUPERUSER, but not availabl… (langgenius#24108)
1 parent 16d1289 commit 8288b1d

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

api/configs/middleware/vdb/pgvector_config.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ class PGVectorConfig(BaseSettings):
99
Configuration settings for PGVector (PostgreSQL with vector extension)
1010
"""
1111

12-
PGVECTOR_IS_OWNER: Optional[bool] = Field(
13-
description="Whether the PGVector is the owner of the database",
14-
default=True,
15-
)
16-
1712
PGVECTOR_HOST: Optional[str] = Field(
1813
description="Hostname or IP address of the PostgreSQL server with PGVector extension (e.g., 'localhost')",
1914
default=None,

api/core/rag/datasource/vdb/pgvector/pgvector.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ def _create_collection(self, dimension: int):
253253
return
254254

255255
with self._get_cursor() as cur:
256-
if dify_config.PGVECTOR_IS_OWNER:
257-
cur.execute("CREATE EXTENSION IF NOT EXISTS vector")
256+
cur.execute("CREATE EXTENSION IF NOT EXISTS vector")
258257
cur.execute(SQL_CREATE_TABLE.format(table_name=self.table_name, dimension=dimension))
259258
# PG hnsw index only support 2000 dimension or less
260259
# ref: https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing

0 commit comments

Comments
 (0)