Parameter · Client Connection Defaults / Locale and Formatting
default_text_search_config
Sets default text search configuration.
- Default:
pg_catalog.simple - Type: string
- Applies: Session (any user)
In plain words
Full-text search needs to know the language: which words are noise ("the", "were") and how to reduce words to their stem ("running" to "run"). This setting picks the configuration used when a query does not name one.
For DBAs and operators
Affects the one-argument forms to_tsvector(text), to_tsquery(text), plainto_tsquery, websearch_to_tsquery and ts_headline. The built-in default is pg_catalog.simple, but initdb sets a value matching lc_ctype when it can (for example pg_catalog.english).
Pitfalls:
- Because the one-argument functions depend on this setting, they are not immutable and cannot be used in an index expression. Always name the configuration:
CREATE INDEX … USING gin (to_tsvector('english', body)), and use the same two-argument form in queries or the index is not used. - A tsvector built with one configuration and queried with another silently finds fewer rows (stems differ:
'cat'vs'cats'). - Different databases or roles can have different values via
ALTER DATABASE/ROLE … SET, so results differ between environments.
List available configurations with \dF or SELECT cfgname FROM pg_ts_config.
How to change it
Any user can change it for their session with SET.