↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / SQL Commands

CREATE TEXT SEARCH DICTIONARY

define a new text search dictionary

English manual coverage begins with PostgreSQL 6.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

anchor
SQL-CREATETSDICTIONARY
file
sql-createtsdictionary.html
lang
en
name
CREATE TEXT SEARCH DICTIONARY
purpose
define a new text search dictionary
purpose zh
定义一个新的文本检索词典
sections same as
Unknown
slug
18
synopsis text
CREATE TEXT SEARCH DICTIONARY name ( TEMPLATE = template [, option = value [, ... ]] )

Syntax

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

Read left to right. Branches are choices, bypasses are optional, loops repeat. Select an underlined parameter to open its rule.

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

Definition PG 18

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

Description

CREATE TEXT SEARCH DICTIONARY creates a new text search dictionary. A text search dictionary specifies a way of recognizing interesting or uninteresting words for searching. A dictionary depends on a text search template, which specifies the functions that actually perform the work. 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 is created in the current schema.

The user who defines a text search dictionary becomes its owner.

Refer to Chapter 12 for further information.

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.

option

The name of a template-specific option to be set for this dictionary.

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).

The options can appear in any order.

Examples

The following example command creates a Snowball-based dictionary with a nonstandard list of stop words.

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.

See Also

ALTER TEXT SEARCH DICTIONARY, DROP TEXT SEARCH DICTIONARY

Compare versions

Complete source facts

synopsis html

CREATE TEXT SEARCH DICTIONARY <em class="replaceable"><code>name</code></em> (
    TEMPLATE = <em class="replaceable"><code>template</code></em>
    [, <em class="replaceable"><code>option</code></em> = <em class="replaceable"><code>value</code></em> [, ... ]]
)

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:c6489fad03cfb36bb015368bcc5d1ed45f4e93b5e915cabc7819501425efab66

Text language: en · wiki-repair-20261023:c6489fad03cfb36bb015368bcc5d1ed45f4e93b5e915cabc7819501425efab66