Skip to content
masterclass Buddy

PostgreSQL · Function

to_tsquery

to_tsquery converts a structured text query into a tsquery value. It normalizes words, removes stop words, and supports operators, weights, and prefix matching.

Last updated

Syntax

to_tsquery([ config regconfig, ] querytext text) returns tsquery

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • plainto_tsquery
  • phraseto_tsquery
  • websearch_to_tsquery
  • to_tsvector
  • tsquery
  • tsvector
  • @@

Source: PostgreSQL: Documentation: 18: 12.3. Controlling Text Search. Checked 2026-11-03.