Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:

Bug description When doing a similaritySearch using the VectorStore on a database where the schema name contains a - i run into an exception.

PreparedStatementCallback; bad SQL grammar [SELECT *, embedding <=> ? AS distance FROM demo-1998.vector_store WHERE embedding <=> ? < ?  AND metadata::jsonb @@ '($.entityType == "PROCESS" ...)'::jsonpath  ORDER BY distance LIMIT ? ]

I'm pretty sure that it is related to the schema name here. A possible fix could be wrapping the schema name in " on SpringAI side.

Environment Dependencies using Spring Boot 3.5.4 and Java 20

implementation("org.springframework.ai:spring-ai-starter-mcp-server-webmvc")
implementation("org.springframework.ai:spring-ai-starter-model-azure-openai")
implementation("org.springframework.ai:spring-ai-starter-vector-store-pgvector")

Steps to reproduce - Do a similaritySearch call on a database schema which has a - in its name

Expected behavior No exceptions are thrown

Minimal Complete Reproducible example

Comment From: wilocu

take