Bird
0
0

What is wrong with this query?

medium📝 Debug Q6 of 15
PostgreSQL - Full-Text Search
What is wrong with this query?
SELECT to_tsvector('english', ARRAY['PostgreSQL', 'rocks']);
Ato_tsvector does not accept an array as input for the text parameter.
BThe language configuration 'english' is invalid.
CThe function requires a numeric second argument.
DThe query is missing a FROM clause.
Step-by-Step Solution
Solution:
  1. Step 1: Check input types for to_tsvector

    to_tsvector expects a string as the second argument, not an array.
  2. Step 2: Validate other options

    'english' is a valid configuration; numeric argument is not required; FROM clause is optional for this select.
  3. Final Answer:

    to_tsvector does not accept an array as input for the text parameter. -> Option A
  4. Quick Check:

    to_tsvector requires text, not array [OK]
Quick Trick: to_tsvector needs text, not arrays [OK]
Common Mistakes:
  • Passing arrays instead of text
  • Misunderstanding language config validity
  • Expecting FROM clause in simple selects

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes