File tree 1 file changed +25
-3
lines changed
ann_benchmarks/algorithms/pgvector
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
+
1
25
import subprocess
2
26
import sys
3
27
import os
4
- import logging
5
28
6
29
import pgvector .psycopg
7
30
import psycopg
11
34
from ..base .module import BaseANN
12
35
from ...util import get_bool_env_var
13
36
14
-
15
37
def get_pg_param_env_var_name (pg_param_name : str ) -> str :
16
38
return f'ANN_BENCHMARKS_PG_{ pg_param_name .upper ()} '
17
39
@@ -88,7 +110,7 @@ def fit(self, X):
88
110
stdout = sys .stdout ,
89
111
stderr = sys .stderr )
90
112
else :
91
- logging . info (
113
+ print (
92
114
"Assuming that PostgreSQL service is managed externally. "
93
115
"Not attempting to start the service." )
94
116
You can’t perform that action at this time.
0 commit comments