CREATE_TEXT_SEARCH_PARSER(7pg14)

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

πŸ’– 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 ⭐


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