ALTER_TEXT_SEARCH_CONFIGURATION(7pg13)
π ALTER TEXT SEARCH CONFIGURATION (7pg13) β the glow-up edition β¨
okay bestie, so this is the page for ALTER_TEXT_SEARCH_CONFIGURATION from the PostgreSQL 13.23 Documentation, and it's basically the "let me change my whole text-search vibe" command. get comfy π«Ά
β¨ NAME β¨
ALTER_TEXT_SEARCH_CONFIGURATION β change the definition of a text search configuration π
like, you can reshuffle it, rename it, hand it off to someone elseβ¦ the whole makeover. π
πΈ SYNOPSIS πΈ
ALTER TEXT SEARCH CONFIGURATION name
ADD MAPPING FOR token_type [, ... ] WITH dictionary_name [, ... ]
ALTER TEXT SEARCH CONFIGURATION name
ALTER MAPPING FOR token_type [, ... ] WITH dictionary_name [, ... ]
ALTER TEXT SEARCH CONFIGURATION name
ALTER MAPPING REPLACE old_dictionary WITH new_dictionary
ALTER TEXT SEARCH CONFIGURATION name
ALTER MAPPING FOR token_type [, ... ] REPLACE old_dictionary WITH new_dictionary
ALTER TEXT SEARCH CONFIGURATION name
DROP MAPPING [ IF EXISTS ] FOR token_type [, ... ]
ALTER TEXT SEARCH CONFIGURATION name RENAME TO new_name
ALTER TEXT SEARCH CONFIGURATION name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
ALTER TEXT SEARCH CONFIGURATION name SET SCHEMA new_schema
copy these exactly, bestie, they're not vibes you can freestyle π
π¦ DESCRIPTION π¦
ALTER TEXT SEARCH CONFIGURATION changes the definition of a text search configuration. lowkey iconic? you can modify its mappings from token types to dictionaries, or change the configuration's name or owner. it's giving full rebrand. β¨
β οΈ okay important: you must be the owner of the configuration to use ALTER TEXT SEARCH CONFIGURATION. no owner energy, no makeover. periodt.
π PARAMETERS π
nameβ the name (optionally schema-qualified) of an existing text search configuration. like, the one you're about to glam up.token_typeβ the name of a token type that is emitted by the configuration's parser. the parser hands it to you, you don't invent it π§dictionary_nameβ the name of a text search dictionary to be consulted for the specified token type(s). if multiple dictionaries are listed, they are consulted in the specified order. order matters, iykyk.old_dictionaryβ the name of a text search dictionary to be replaced in the mapping. the one getting swapped out πnew_dictionaryβ the name of a text search dictionary to be substituted forold_dictionary. the one stepping into the spotlight πnew_nameβ the new name of the text search configuration.new_ownerβ the new owner of the text search configuration.new_schemaβ the new schema for the text search configuration.
and now the actual behaviour tea, because this is the part that matters π₯:
- the
ADD MAPPING FORform installs a list of dictionaries to be consulted for the specified token type(s); it is an error if there is already a mapping for any of the token types. no duplicates allowed, it will literally yell at you π - the
ALTER MAPPING FORform does the same, but first removing any existing mapping for those token types. out with the old, in with the new π - the
ALTER MAPPING REPLACEforms substitutenew_dictionaryforold_dictionaryanywhere the latter appears. this is done for only the specified token types whenFORappears, or for all mappings of the configuration when it doesn't. soFOR= precise, noFOR= everywhere at once. choose wisely π - the
DROP MAPPINGform removes all dictionaries for the specified token type(s), causing tokens of those types to be ignored by the text search configuration. and it is an error if there is no mapping for the token types β unlessIF EXISTSappears.IF EXISTSis your emotional support flag, fr fr π«Ά
π EXAMPLES π
the following example replaces the english dictionary with the swedish dictionary anywhere that english is used within my_config. slay, honestly.
ALTER TEXT SEARCH CONFIGURATION my_config
ALTER MAPPING REPLACE english WITH swedish;
see how there's no FOR? that's the "do it everywhere" mode. main character energy move. β
β COMPATIBILITY β
there is no ALTER TEXT SEARCH CONFIGURATION statement in the SQL standard.
soβ¦ it's a PostgreSQL original, bestie. not a single standard to be found. πβ¨
π SEE ALSO π
CREATE TEXT SEARCH CONFIGURATION(CREATE_TEXT_SEARCH_CONFIGURATION(7)) β for making one in the first placeDROP TEXT SEARCH CONFIGURATION(DROP_TEXT_SEARCH_CONFIGURATION(7)) β for when it's time to say bye π¦
okay that's the whole page, no notes π
sign-off time: this little masterpiece is from PostgreSQL 13.23, dated 2025 β and the header/footer were giving ALTER TE...IGURATION(7) because terminal truncation is a hater π go forth and remap your dictionaries, bestie ππΈπ«Ά
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-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