CREATE_TEXT_SEARCH_DICTIONARY(7pg14)

πŸ“¦ version 14.24, in opensuse-leap 16.0

✨ CREATE_TEXT_SEARCH_DICTIONARY β€” define a new text search dictionary ✨

Okay bestie, we're in the CREATE_TEXT_SEARCH_DICTIONARY(7) page, PostgreSQL 14.24 Documentation era, and this one is literally about making your very own text search dictionary. It's giving "custom word vibes" and I am obsessed. πŸŽ€


🌸 NAME 🌸

CREATE_TEXT_SEARCH_DICTIONARY β€” define a new text search dictionary


πŸ¦‹ SYNOPSIS πŸ¦‹

CREATE TEXT SEARCH DICTIONARY name (
    TEMPLATE = template
    [, option = value [, ... ]]
)

πŸ’– DESCRIPTION πŸ’–

So, CREATE TEXT_SEARCH_DICTIONARY… wait, no, it's CREATE TEXT_SEARCH_DICTIONARY? Nope. The actual command is CREATE TEXT_SEARCH_DICTIONARY? Let me breathe. It's CREATE TEXT_SEARCH_DICTIONARYβ€”okay I keep doing that. The real one is CREATE TEXT SEARCH DICTIONARY (spaces, bestie, spaces). And what it does is create a new text search dictionary. No cap. πŸ’…

A text search dictionary specifies a way of recognizing interesting or uninteresting words for searching. It's literally the vibe-checker for which words matter. The way that a dictionary depends on a text search template? That template specifies the functions that actually perform the work. So the dictionary is like the main character, but the template is the whole production crew behind her. 🎬

Typically the dictionary provides some options that control the detailed behavior of the template's functions.

If a schema name is given, then the text search dictionary is created in the specified schema. Otherwise it's created in the current schema.

The user who defines a text search dictionary becomes its owner. Slay, ownership era. πŸ‘‘

Refer to Chapter 12 for further information. (iykyk πŸ“š)


πŸ’œ PARAMETERS πŸ’œ

  • name β€” the name of the text search dictionary to be created. The name can be schema-qualified. 🏷️
  • template β€” the name of the text search template that will define the basic behavior of this dictionary. This is the blueprint, the moment, the foundation.
  • option β€” the name of a template-specific option to be set for this dictionary. Customization queen.
  • value β€” the value to use for a template-specific option. If the value is not a simple identifier or number, it must be quoted (but you can always quote it, if you wish). Do it for the plot, honestly. πŸ™ˆ

The options can appear in any order. No rules, just right. ✨


πŸ”₯ EXAMPLES πŸ”₯

This next example command creates a Snowball-based dictionary with a nonstandard list of stop words. We love a nonstandard stop word list, fr fr.

CREATE TEXT SEARCH DICTIONARY my_russian (
    template = snowball,
    language = russian,
    stopwords = myrussian
);

🌈 COMPATIBILITY 🌈

There is no CREATE TEXT SEARCH DICTIONARY statement in the SQL standard. Not a single crumb. The standard simply did not serve. πŸ’€


🫢 SEE ALSO 🫢


And that's the whole page, bestie. This was PostgreSQL 14.24, dated 2026 β€” catch you on the next manpage, mwah. πŸ’‹πŸŽ€πŸŒ·

πŸ“¦ where this page comes from