Description:
In the v2 AsyncPGVectorStore, raw SQL string construction is used instead of an ORM. While methods like aadd_embeddings correctly quote columns (e.g. "{self.id_column}"), the quoting is missing in two critical places:
adelete: Uses f"{self.id_column} in ..." without quotes.
_create_filter_clause: Uses self.metadata_json_column and top-level column names without quotes.
If a user configures id_column or metadata_json_column with mixed-case characters (e.g. "MyId" or "My Json"), PostgreSQL folds the unquoted identifier to lowercase, resulting in a syntax error or column does not exist.
Description:
In the
v2AsyncPGVectorStore, raw SQL string construction is used instead of an ORM. While methods likeaadd_embeddingscorrectly quote columns (e.g."{self.id_column}"), the quoting is missing in two critical places:adelete: Usesf"{self.id_column} in ..."without quotes._create_filter_clause: Usesself.metadata_json_columnand top-level column names without quotes.If a user configures
id_columnormetadata_json_columnwith mixed-case characters (e.g."MyId"or"My Json"), PostgreSQL folds the unquoted identifier to lowercase, resulting in a syntax error orcolumn does not exist.