Taragolis commented on code in PR #34891:
URL: https://github.com/apache/airflow/pull/34891#discussion_r1365275358


##########
airflow/providers/postgres/hooks/postgres.py:
##########
@@ -320,6 +320,32 @@ def _generate_insert_sql(
 
         return sql
 
+    def ingest_embedding(self, table: str, input_data: Iterable[tuple[str, 
list[float]]], vector_size: int) -> None:
+        """
+        Store embedding vector in Postgres table.
+
+        :param table: The Name of the table
+        :param input_data: Iterable containing tuples of input data and 
corresponding embedding vectors.
+        :param vector_size: The size of vector. The maximum dimensions can be 
2,000
+        """
+        from pgvector.psycopg import register_vector
+        from psycopg2 import sql
+
+        self.conn.execute("CREATE EXTENSION IF NOT EXISTS vector")

Review Comment:
   ```suggestion
   ```
   
   AFAIK, before Postgres 13 CREATE EXTENSION required superuser permissions, 
in PG 13+ trusted extension could be installed by someone with appropriate 
CREATE, however it is not a case of 
[pgvector](https://github.com/pgvector/pgvector/issues/288)
   
   So let keep create extensions for DBAs or for some one with appropriate 
permissions. We should not force users to use SU in their databases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to