File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
ann_benchmarks/algorithms/pgvector Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 1+ """
2+ This module supports connecting to a PostgreSQL instance and performing vector
3+ indexing and search using the pgvector extension. The default behavior uses
4+ the "ann" value of PostgreSQL user name, password, and database name, as well
5+ as the default host and port values of the psycopg driver.
6+
7+ If PostgreSQL is managed externally, e.g. in a cloud DBaaS environment, the
8+ environment variable overrides listed below are available for setting PostgreSQL
9+ connection parameters:
10+
11+ ANN_BENCHMARKS_PG_USER
12+ ANN_BENCHMARKS_PG_PASSWORD
13+ ANN_BENCHMARKS_PG_DBNAME
14+ ANN_BENCHMARKS_PG_HOST
15+ ANN_BENCHMARKS_PG_PORT
16+
17+ This module starts the PostgreSQL service automatically using the "service"
18+ command. The environment variable ANN_BENCHMARKS_PG_START_SERVICE could be set
19+ to "false" (or e.g. "0" or "no") in order to disable this behavior.
20+
21+ This module will also attempt to create the pgvector extension inside the
22+ target database, if it has not been already created.
23+ """
24+
125import subprocess
226import sys
327import os
4- import logging
528
629import pgvector .psycopg
730import psycopg
1134from ..base .module import BaseANN
1235from ...util import get_bool_env_var
1336
14-
1537def get_pg_param_env_var_name (pg_param_name : str ) -> str :
1638 return f'ANN_BENCHMARKS_PG_{ pg_param_name .upper ()} '
1739
@@ -88,7 +110,7 @@ def fit(self, X):
88110 stdout = sys .stdout ,
89111 stderr = sys .stderr )
90112 else :
91- logging . info (
113+ print (
92114 "Assuming that PostgreSQL service is managed externally. "
93115 "Not attempting to start the service." )
94116
You can’t perform that action at this time.
0 commit comments