CREATE_TEXT_SEARCH_TEMPLATE(7pg15)

πŸ“¦ version 15.19, in opensuse-leap 16.0

✨ 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 πŸ‘‘


xoxo, PostgreSQL 15.19 πŸ’– β€” dated 2026. go slay your text search setup, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from