ALTER_TEXT_SEARCH_DICTIONARY(7pg14)
π ALTER TEXT SEARCH DICTIONARY
okay so bestie, welcome to ALTER TEXT SEARCH DICTIONARY β that's page 7 of the PostgreSQL 14.24 Documentation, and yes we are reading the docs together, this is our bonding time π«Ά
β¨ NAME β¨
ALTER_TEXT_SEARCH_DICTIONARY β the glow-up command for a text search dictionary. It changes the definition of a text search dictionary. Iconic.
π SYNOPSIS π
ALTER TEXT SEARCH DICTIONARY name (
option [ = value ] [, ... ]
)
ALTER TEXT SEARCH DICTIONARY name RENAME TO new_name
ALTER TEXT SEARCH DICTIONARY name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER TEXT SEARCH DICTIONARY name SET SCHEMA new_schema
like, four whole vibes, pick your fighter π
πΈ DESCRIPTION πΈ
So ALTER TEXT SEARCH DICTIONARY changes the definition of a text search dictionary. You can change the dictionary's template-specific options, or change the dictionary's name or owner. Three levers, all yours π₯
β οΈ real talk: you must be the owner of the dictionary to use ALTER TEXT SEARCH DICTIONARY. no ownership, no entry. no cap.
π¦ PARAMETERS π¦
nameβ the name of an existing text search dictionary (optionally schema-qualified, bc we keep it flexible like that).optionβ the name of a template-specific option to be set for this dictionary.valueβ the new value to use for a template-specific option. and here's the cute part: if the equal sign and value are omitted, then any previous setting for the option is removed from the dictionary, allowing the default to be used. like a little reset button, lowkey π«Άnew_nameβ the new name of the text search dictionary.new_ownerβ the new owner of the text search dictionary.new_schemaβ the new schema for the text search dictionary.
Also, tiny detail that ate: Template-specific options can appear in any order. no rules, just right β¨
π EXAMPLES π
okay example time, this is the fun part π
The following example command changes the stopword list for a Snowball-based dictionary. Other parameters remain unchanged.
ALTER TEXT SEARCH DICTIONARY my_dict ( StopWords = newrussian );
The following example command changes the language option to dutch, and removes the stopword option entirely. not me multitasking π
ALTER TEXT SEARCH DICTIONARY my_dict ( language = dutch, StopWords );
The following example command βupdatesβ the dictionary's definition without actually changing anything. the audacity, the confidence, the main character energy π
ALTER TEXT SEARCH DICTIONARY my_dict ( dummy );
(and the reason this works is that the option removal code doesn't complain if there is no such option.) bestie this trick is genuinely useful when changing configuration files for the dictionary: the ALTER will force existing database sessions to re-read the configuration files, which otherwise they would never do if they had read them earlier. like, sessions are stubborn, we love a forced refresh π
β COMPATIBILITY β
There is no ALTER TEXT SEARCH DICTIONARY statement in the SQL standard. so we're just out here being extra, standards who? π
π SEE ALSO π
CREATE TEXT SEARCH DICTIONARY(CREATE_TEXT_SEARCH_DICTIONARY(7))DROP TEXT SEARCH DICTIONARY(DROP_TEXT_SEARCH_DICTIONARY(7))
the holy trinity: make it, change it, drop it π¦
and that's the page! brought to you by PostgreSQL 14.24, dated 2026 β tysm for reading the docs with me bestie, mwah ππβ¨
π¦ 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