CREATE_TEXT_SEARCH_CONFIGURATION(7)

๐Ÿ’… CREATE_TEXT_SEARCH_CONFIGURATION โ€” define a new text search configuration

okay bestie, welcome to the CREATE_TEXT_SEARCH_CONFIGURATION(7) page from the PostgreSQL 18.6 Documentation โœจ this is the glow-up tutorial for teaching your database how to actually read text. let's get into it ๐ŸŽ€


โœจ SYNOPSIS โœจ

CREATE TEXT SEARCH CONFIGURATION name (
    PARSER = parser_name |
    COPY = source_config
)

that's the whole vibe check right there ๐Ÿฆ‹


๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so. CREATE TEXT SEARCH CONFIGURATION makes a brand-new text search configuration. and a text search configuration is basically the whole package: it specifies a text search parser that can divide a string into tokens, plus the dictionaries that can be used to figure out which tokens are actually of interest for searching ๐Ÿ”

now here's the thing. if you only specify the parser, then your shiny new text search configuration initially has no mappings from token types to dictionaries, which means... it will literally ignore all words ๐Ÿ˜ญ like it's just standing there, gorgeous, useless. so you must run subsequent ALTER TEXT SEARCH CONFIGURATION commands to create mappings and make the configuration actually useful. alternatively โ€” and this is the shortcut, no cap โ€” you can just copy an existing text search configuration ๐Ÿ’–

if a schema name is given, then the text search configuration gets created in that specified schema. otherwise it's created in the current schema, iykyk.

the user who defines a text search configuration becomes its owner ๐Ÿ‘‘ own it, bestie.

refer to Chapter 12 for further information ๐Ÿ“š


๐ŸŽ€ PARAMETERS ๐ŸŽ€

  • name โ€” the name of the text search configuration to be created. and yes, the name can be schema-qualified โœจ
  • parser_name โ€” the name of the text search parser to use for this configuration. this is the one doing the tokenizing ๐Ÿ’…
  • source_config โ€” the name of an existing text search configuration to copy. copy-paste but make it fashion ๐Ÿฆ‹

๐Ÿ”ฅ NOTES ๐Ÿ”ฅ

the PARSER and COPY options are mutually exclusive โ€” you can't do both, periodt. the reason is lowkey cute actually: when an existing configuration is copied, its parser selection is copied too ๐ŸŒˆ so there's no need, and no room, for both.

ngl don't try to sneak both in there, it's not gonna slay, it's gonna error ๐Ÿ’€

๐Ÿ’€ COMPATIBILITY ๐Ÿ’€

there is no CREATE TEXT SEARCH CONFIGURATION statement in the SQL standard. we're built different, sorry to the standard ๐Ÿ’…


๐ŸŒŸ SEE ALSO ๐ŸŒŸ


okay that's the whole page bestie, you ate that ๐Ÿ“ go forth and configure your text searches, main character energy only ๐Ÿ‘‘

PostgreSQL 18.6 ยท 2026 โ€” mwah, that's the version and the date, love u, bye ๐Ÿ’–โœจ๐ŸŽ€