CREATE_TEXT_SEARCH_CONFIGURATION(7pg18)
๐ 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 ๐
ALTER TEXT SEARCH CONFIGURATION(ALTER_TEXT_SEARCH_CONFIGURATION(7)) ๐ซถDROP TEXT SEARCH CONFIGURATION(DROP_TEXT_SEARCH_CONFIGURATION(7)) ๐ซถ
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 ๐โจ๐
๐ฆ where this page comes from
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms