CREATE_TEXT_SEARCH_TEMPLATE(7pg13)

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

πŸ’– NAME πŸ’–

okay bestie, welcome to the CREATE_TEXT_SEARCH_TEMPLATE(7pg13) manual page β€” this is the text-search-template zone ✨

CREATE_TEXT_SEARCH_TEMPLATE β€” define a new text search template πŸ’…


✨ SYNOPSIS ✨

CREATE TEXT SEARCH TEMPLATE name (
    [ INIT = init_function , ]
    LEXIZE = lexize_function
)

πŸ¦‹ DESCRIPTION πŸ¦‹

So CREATE TEXT SEARCH TEMPLATE creates a new text search template, no cap. Text search templates define the functions that implement text search dictionaries. A template is not useful by itself, bestie β€” it must be instantiated as a dictionary to actually be used. And that dictionary typically specifies parameters to be given to the template functions. iykyk 🫢

If a schema name is given, then the text search template is created in the specified schema. Otherwise? It’s 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 😭 β€” yes, fr fr, server stability is the main character here.

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 logic πŸ’…

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. periodt ✨

πŸ“ 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. Rember that split, bestie 🧚

The arguments can appear in any order, not only the one shown above. No need to be all rigid about it πŸ’«


πŸ’… COMPATIBILITY πŸ’…

There is no CREATE TEXT SEARCH TEMPLATE statement in the SQL standard. The SQL standard said β€œnot today,” and honestly? We respect it πŸ™ˆ


🌈 SEE ALSO 🌈


πŸ’Œ that’s the whole vibe. Source/version: PostgreSQL 13.23; date: 2025. Catch you in the next man page, bestie β€” periodt πŸ’…βœ¨

πŸ“¦ where this page comes from