CREATE_TEXT_SEARCH_PARSER(7pg14)
π CREATE_TEXT_SEARCH_PARSER π
okay bestie, this is the CREATE_TEXT_SEARCH_PARSER page from the PostgreSQL 14 docs (manual page CREATE_T...CH_PARSER(7)) β yes the header is literally abbreviated like that, that's just how it's printed, don't come for me π anyway, buckle up π
β¨ NAME β¨
CREATE_TEXT_SEARCH_PARSER β define a new text search parser π
πΈ SYNOPSIS πΈ
CREATE TEXT SEARCH PARSER name (
START = start_function ,
GETTOKEN = gettoken_function ,
END = end_function ,
LEXTYPES = lextypes_function
[, HEADLINE = headline_function ]
)
π¦ DESCRIPTION π¦
So CREATE TEXT SEARCH PARSER creates a new text search parser. and what does a parser do, you ask? it defines a method for splitting a text string into tokens and assigning types (categories) to those tokens. iconic behavior honestly π
but here's the thing β a parser is not particularly useful by itself. it has to be bound into a text search configuration along with some text search dictionaries to actually be used for searching. it's giving "supporting character who's actually the whole plot" ngl π«Ά
if a schema name is given, then the text search parser is created in that specified schema. otherwise it's created in the current schema. easy β¨
β οΈ you must be a superuser to use CREATE TEXT SEARCH PARSER. and before you get mad at the gatekeeping: this restriction is made because an erroneous text search parser definition could confuse or even crash the server ππ like genuinely, this is not a drill.
refer to Chapter 12 for further information π
π PARAMETERS π
nameβ the name of the text search parser to be created. the name can be schema-qualified. slay, flexible naming πstart_functionβ the name of the start function for the parser.gettoken_functionβ the name of the get-next-token function for the parser.end_functionβ the name of the end function for the parser.lextypes_functionβ the name of the lextypes function for the parser (that's a function that returns information about the set of token types it produces π§).headline_functionβ the name of the headline function for the parser (that's a function that summarizes a set of tokens, tiny little summary icon energy π).
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 β no cap, it's already decided for you π. all except the headline function are required.
and bestie, the arguments can appear in any order, not only the one shown above. go off, arrange them however your heart desires π
π COMPATIBILITY π
there is no CREATE TEXT SEARCH PARSER statement in the SQL standard. we're built different, iykyk π
β¨
β SEE ALSO β
ALTER TEXT SEARCH PARSER(ALTER_TEXT_SEARCH_PARSER(7))DROP TEXT SEARCH PARSER(DROP_TEXT_SEARCH_PARSER(7))
okay that's the whole page, go build your parser you absolute icon ππ and a lil sign-off for the credits: this was PostgreSQL 14.24 Documentation, dated 2026, and the footer on the original page is literally just CREATE T...CH PARSER(7) again because manpages love to repeat themselves π periodt πΈ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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