CREATE_TEXT_SEARCH_TEMPLATE(7pg15)
β¨ CREATE_TEXT_SEARCH_TEMPLATE β¨
hey bestie, welcome to the PostgreSQL 15.19 manual page for CREATE_TEXT_SEARCH_TEMPLATE(7) β we're defining a brand-new text search template today and honestly? iconic behavior π
π NAME π
CREATE_TEXT_SEARCH_TEMPLATEβ define a new text search template β¨
π SYNOPSIS π
CREATE TEXT SEARCH TEMPLATE name (
[ INIT = init_function , ]
LEXIZE = lexize_function
)
π¦ DESCRIPTION π¦
okay so CREATE TEXT SEARCH TEMPLATE creates a new text search template. Text search templates define the functions that implement text search dictionaries. A template is not useful by itself β it has to be instantiated as a dictionary to actually be used. The dictionary typically specifies parameters to be given to the template functions. no cap, that's the whole vibe π«Ά
If a schema name is given, then the text search template is created in the specified schema. Otherwise it is created in the current schema. simple as that π«
You must be a superuser to use CREATE TEXT SEARCH TEMPLATE. This restriction is made because an erroneous text search template definition could confuse or even crash the server π. The reason for separating templates from dictionaries is that a template encapsulates the βunsafeβ aspects of defining a dictionary. The parameters that can be set when defining a dictionary are safe for unprivileged users to set, and so creating a dictionary need not be a privileged operation. slay, permissions boundaries β¨
Refer to Chapter 12 for further information π
πΈ PARAMETERS πΈ
nameβ the name of the text search template to be created. The name can be schema-qualified. πinit_functionβ the name of the init function for the template. β¨lexize_functionβ the name of the lexize function for the template. π¦
The function names can be schema-qualified if necessary. Argument types are not given, since the argument list for each type of function is predetermined. The lexize function is required, but the init function is optional. lowkey flexible, highkey structured π
The arguments can appear in any order, not only the one shown above. mix and match, bestie π
π COMPATIBILITY π
There is no CREATE TEXT SEARCH TEMPLATE statement in the SQL standard. we're built different, fr fr π
π SEE ALSO π
ALTER TEXT SEARCH TEMPLATE(ALTER_TEXT_SEARCH_TEMPLATE(7))DROP TEXT SEARCH TEMPLATE(DROP_TEXT_SEARCH_TEMPLATE(7))
xoxo, PostgreSQL 15.19 π β dated 2026. go slay your text search setup, bestie πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms