Question 390
A developer interpolates free-text metadata directly into a PostgreSQL search SQL string. What result MOST directly verifies that the solution works?
Explanation
Correct Answer
Bound SQL parameters separate untrusted inputs from executable query syntax. The observed result “Malicious filter text is treated as a value and legitimate search results remain correct” would confirm the change “Use parameterized SQL queries through a supported PostgreSQL driver” in this situation: A developer interpolates free-text metadata directly into a PostgreSQL search SQL string.
Incorrect Answers
Database-enforced row-level security protects data independently of application filter correctness. The situation here is: A developer interpolates free-text metadata directly into a PostgreSQL search SQL string. A test of this alternative would miss the specific outcome “Malicious filter text is treated as a value and legitimate search results remain correct”.
PostgreSQL can combine relational filters with embedding distance queries. The situation here is: A developer interpolates free-text metadata directly into a PostgreSQL search SQL string. A test of this alternative would miss the specific outcome “Malicious filter text is treated as a value and legitimate search results remain correct”.
ANN index use depends on compatible operators, query shape, and planner cost estimates. The situation here is: A developer interpolates free-text metadata directly into a PostgreSQL search SQL string. A test of this alternative would miss the specific outcome “Malicious filter text is treated as a value and legitimate search results remain correct”.