ALTER_TEXT_SEARCH_DICTIONARY(7)

๐Ÿ’– ALTER TEXT SEARCH DICTIONARY ๐Ÿ’–

okay bestie, so this is the PostgreSQL 18.6 manual page for ALTER_TEXT_SEARCH_DICTIONARY(7) โ€” yes the title is literally screaming at you in all caps, that's just how manpages are, they're dramatic like that ๐Ÿ’…


โœจ NAME โœจ

ALTER_TEXT_SEARCH_DICTIONARY โ€” change the definition of a text search dictionary ๐Ÿฆ‹


๐ŸŒธ 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

๐Ÿ‘‘ DESCRIPTION ๐Ÿ‘‘

So like. ALTER TEXT SEARCH DICTIONARY changes the definition of a text search dictionary. That's it, that's the whole vibe โœจ

You can change the dictionary's template-specific options, or you can change the dictionary's name or owner. Mix and match, choose your own adventure, main character energy fr fr.

๐Ÿ’€ but listen โ€” you must be the owner of the dictionary to use ALTER TEXT SEARCH DICTIONARY. no owner privileges, no entry. periodt.

๐ŸŽ€ PARAMETERS ๐ŸŽ€

  • name โ€” the name of an existing text search dictionary. optionally schema-qualified, so you can be extra specific if you want ๐Ÿซถ
  • option โ€” the name of a template-specific option that's getting set for this dictionary.
  • value โ€” the new value for that template-specific option. and here's the tea: if you skip the equal sign and the value entirely, then any previous setting for that option gets removed from the dictionary, which lets the default just do its thing ๐ŸŒˆ
  • new_name โ€” the new name of the text search dictionary. glow up name change โœจ
  • new_owner โ€” the new owner of the text search dictionary.
  • new_schema โ€” the new schema for the text search dictionary.

also!! template-specific options can appear in any order. no rules, no order, we're free ๐Ÿฆ‹


๐Ÿ“ EXAMPLES ๐Ÿ“

okay example time, this is the fun part, look at her go ๐Ÿ’–

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.

ALTER TEXT SEARCH DICTIONARY my_dict ( language = dutch, StopWords );

The following example command โ€œupdatesโ€ the dictionary's definition without actually changing anything. yes bestie, a no-op, and it's iconic for it ๐Ÿ’…

ALTER TEXT SEARCH DICTIONARY my_dict ( dummy );

(The reason this works is that the option removal code doesn't complain if there is no such option.) This trick is 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. so like, a lil sneaky refresh button. lowkey genius, no cap ๐Ÿ”ฅ


๐ŸŒˆ COMPATIBILITY ๐ŸŒˆ

There is no ALTER TEXT SEARCH DICTIONARY statement in the SQL standard. not a standard girlie, she's a PostgreSQL original ๐Ÿ˜Œ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ


and that's the whole page bestie!! this was PostgreSQL 18.6, dated 2026 โ€” go forth and alter ur dictionaries, you absolute icon ๐Ÿ‘‘๐Ÿ’–โœจ