Bird
0
0

Identify the error in this query:

medium📝 Debug Q14 of 15
PostgreSQL - Full-Text Search
Identify the error in this query:
SELECT to_tsvector(english, 'PostgreSQL is great');
AThe function name is misspelled.
BMissing quotes around the text string.
Cto_tsvector does not accept two arguments.
DMissing quotes around the language name 'english'.
Step-by-Step Solution
Solution:
  1. Step 1: Check argument types in the query

    The language name must be a string literal, so it needs quotes: 'english'.
  2. Step 2: Verify other parts

    The text is correctly quoted. The function accepts two arguments. The name is spelled correctly.
  3. Final Answer:

    Missing quotes around the language name 'english'. -> Option D
  4. Quick Check:

    Language must be a quoted string [OK]
Quick Trick: Always quote language names in to_tsvector [OK]
Common Mistakes:
  • Forgetting quotes around language
  • Assuming function takes one argument only
  • Misspelling function name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes