CREATE_TEXT_SEARCH_DICTIONARY(7pg17)

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

πŸ’… CREATE_TEXT_SEARCH_DICTIONARY β€” okay so let's make a dictionary bestie

So this is straight outta the PostgreSQL 17.11 Documentation, and it's the CREATE_TEXT_SEARCH_DICTIONARY(7) page, and honestly? Underrated. Let's get into it ✨


🌸 NAME 🌸

CREATE_TEXT_SEARCH_DICTIONARY β€” define a new text search dictionary πŸŽ€


✨ SYNOPSIS ✨

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

πŸ’– DESCRIPTION πŸ’–

Okay so CREATE TEXT SEARCH DICTIONARY literally creates a new text search dictionary. And what even is that? It's the thing that specifies a way of recognizing interesting or uninteresting words for searching. That's the whole vibe β€” it filters and classifies words πŸ¦‹

A dictionary depends on a text search template, which is the thing that specifies the functions that actually perform the work. So the template does the heavy lifting, and typically the dictionary provides some options that control the detailed behavior of the template's functions. Teamwork, no cap πŸ’…

If a schema name is given, then the text search dictionary is created in the specified schema. Otherwise it is created in the current schema. Simple as that ✨

The user who defines a text search dictionary becomes its owner. Main character energy, you own what you make πŸ‘‘

Refer to Chapter 12 for further information. Highly recommend, iykyk πŸ“–


πŸŽ€ PARAMETERS πŸŽ€

  • name β€” the name of the text search dictionary to be created. The name can be schema-qualified, slay πŸ’œ
  • template β€” the name of the text search template that will define the basic behavior of this dictionary. It's giving foundational 🧚
  • option β€” the name of a template-specific option to be set for this dictionary 🌸
  • value β€” the value to use for a template-specific option. Heads up bestie: if the value is not a simple identifier or number, it must be quoted (but you can always quote it, if you wish) πŸ™ˆ

The options can appear in any order. No rules, just vibes ⭐


πŸ”₯ EXAMPLES πŸ”₯

The following example command creates a Snowball-based dictionary with a nonstandard list of stop words. Look at her go πŸ˜­πŸ’–

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 thing. Zero. Nada. We're built different 🫢


🌈 SEE ALSO 🌈

Go read those next, bestie, they're iconic πŸ‘‘


And that's the page!! Sending you off with the deets: this was PostgreSQL 17.11, dated 2026, and yes I typed all of this for you πŸ’–βœ¨πŸŽ€ mwah

πŸ“¦ where this page comes from