> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/reference/sql-commands/sql-createtsconfig.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# CREATE TEXT SEARCH CONFIGURATION

### CREATE TEXT SEARCH CONFIGURATION

CREATE TEXT SEARCH CONFIGURATION — 定義新的文字搜尋設定

### 語法

```

CREATE TEXT SEARCH CONFIGURATION name (
    PARSER = parser_name |
    COPY = source_config
)
```

### 說明

`CREATE TEXT SEARCH CONFIGURATION` 會建立新的文字搜尋設定。文字搜尋設定指定一個可以將字串切分為語彙單元的文字搜尋剖析器，以及可用來判斷哪些語彙單元是搜尋所關注之對象的字典。

若只指定剖析器，則新的文字搜尋設定一開始沒有從語彙單元類型到字典的對應，因此會忽略所有單字。之後必須使用 `ALTER TEXT SEARCH CONFIGURATION` 命令建立對應，才能讓此設定發揮作用。或者，也可以複製現有的文字搜尋設定。

若指定了綱要名稱，文字搜尋設定就會建立在指定的綱要中；否則會建立在目前的綱要中。

定義文字搜尋設定的使用者會成為其擁有者。

詳細資訊請參閱[第 12 章](https://docs.postgresql.tw/19/the-sql-language/textsearch.md)。

### 參數

*`name`* : 要建立的文字搜尋設定名稱。此名稱可以用綱要限定。

*`parser_name`* : 此設定所要使用的文字搜尋剖析器名稱。

*`source_config`* : 要複製的現有文字搜尋設定名稱。

### 注意事項

`PARSER` 與 `COPY` 選項是互斥的，因為複製現有設定時，其剖析器選擇也會一併複製。

### 相容性

SQL 標準中沒有 `CREATE TEXT SEARCH CONFIGURATION` 陳述式。

### 另請參閱

[ALTER TEXT SEARCH CONFIGURATION](https://docs.postgresql.tw/19/reference/sql-commands/sql-altertsconfig.md), [DROP TEXT SEARCH CONFIGURATION](https://docs.postgresql.tw/19/reference/sql-commands/sql-droptsconfig.md)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/sql-createtsconfig.html)（原文版本：18.6；核對日期：2026-10-03）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/reference/sql-commands/sql-createtsconfig.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
