summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/man7/ALTER_TEXT_SEARCH_CONFIGURATION.7
blob: 0a5b1897e3a30ba6291b7fb6407cb320d2244de3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
'\" t
.\"     Title: ALTER TEXT SEARCH CONFIGURATION
.\"    Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 2023
.\"    Manual: PostgreSQL 15.5 Documentation
.\"    Source: PostgreSQL 15.5
.\"  Language: English
.\"
.TH "ALTER TEXT SEARCH CONFIGURATION" "7" "2023" "PostgreSQL 15.5" "PostgreSQL 15.5 Documentation"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ALTER_TEXT_SEARCH_CONFIGURATION \- change the definition of a text search configuration
.SH "SYNOPSIS"
.sp
.nf
ALTER TEXT SEARCH CONFIGURATION \fIname\fR
    ADD MAPPING FOR \fItoken_type\fR [, \&.\&.\&. ] WITH \fIdictionary_name\fR [, \&.\&.\&. ]
ALTER TEXT SEARCH CONFIGURATION \fIname\fR
    ALTER MAPPING FOR \fItoken_type\fR [, \&.\&.\&. ] WITH \fIdictionary_name\fR [, \&.\&.\&. ]
ALTER TEXT SEARCH CONFIGURATION \fIname\fR
    ALTER MAPPING REPLACE \fIold_dictionary\fR WITH \fInew_dictionary\fR
ALTER TEXT SEARCH CONFIGURATION \fIname\fR
    ALTER MAPPING FOR \fItoken_type\fR [, \&.\&.\&. ] REPLACE \fIold_dictionary\fR WITH \fInew_dictionary\fR
ALTER TEXT SEARCH CONFIGURATION \fIname\fR
    DROP MAPPING [ IF EXISTS ] FOR \fItoken_type\fR [, \&.\&.\&. ]
ALTER TEXT SEARCH CONFIGURATION \fIname\fR RENAME TO \fInew_name\fR
ALTER TEXT SEARCH CONFIGURATION \fIname\fR OWNER TO { \fInew_owner\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER TEXT SEARCH CONFIGURATION \fIname\fR SET SCHEMA \fInew_schema\fR
.fi
.SH "DESCRIPTION"
.PP
\fBALTER TEXT SEARCH CONFIGURATION\fR
changes the definition of a text search configuration\&. You can modify its mappings from token types to dictionaries, or change the configuration\*(Aqs name or owner\&.
.PP
You must be the owner of the configuration to use
\fBALTER TEXT SEARCH CONFIGURATION\fR\&.
.SH "PARAMETERS"
.PP
\fIname\fR
.RS 4
The name (optionally schema\-qualified) of an existing text search configuration\&.
.RE
.PP
\fItoken_type\fR
.RS 4
The name of a token type that is emitted by the configuration\*(Aqs parser\&.
.RE
.PP
\fIdictionary_name\fR
.RS 4
The name of a text search dictionary to be consulted for the specified token type(s)\&. If multiple dictionaries are listed, they are consulted in the specified order\&.
.RE
.PP
\fIold_dictionary\fR
.RS 4
The name of a text search dictionary to be replaced in the mapping\&.
.RE
.PP
\fInew_dictionary\fR
.RS 4
The name of a text search dictionary to be substituted for
\fIold_dictionary\fR\&.
.RE
.PP
\fInew_name\fR
.RS 4
The new name of the text search configuration\&.
.RE
.PP
\fInew_owner\fR
.RS 4
The new owner of the text search configuration\&.
.RE
.PP
\fInew_schema\fR
.RS 4
The new schema for the text search configuration\&.
.RE
.PP
The
ADD MAPPING FOR
form installs a list of dictionaries to be consulted for the specified token type(s); it is an error if there is already a mapping for any of the token types\&. The
ALTER MAPPING FOR
form does the same, but first removing any existing mapping for those token types\&. The
ALTER MAPPING REPLACE
forms substitute
\fInew_dictionary\fR
for
\fIold_dictionary\fR
anywhere the latter appears\&. This is done for only the specified token types when
FOR
appears, or for all mappings of the configuration when it doesn\*(Aqt\&. The
DROP MAPPING
form removes all dictionaries for the specified token type(s), causing tokens of those types to be ignored by the text search configuration\&. It is an error if there is no mapping for the token types, unless
IF EXISTS
appears\&.
.SH "EXAMPLES"
.PP
The following example replaces the
english
dictionary with the
swedish
dictionary anywhere that
english
is used within
my_config\&.
.sp
.if n \{\
.RS 4
.\}
.nf
ALTER TEXT SEARCH CONFIGURATION my_config
  ALTER MAPPING REPLACE english WITH swedish;
.fi
.if n \{\
.RE
.\}
.SH "COMPATIBILITY"
.PP
There is no
\fBALTER TEXT SEARCH CONFIGURATION\fR
statement in the SQL standard\&.
.SH "SEE ALSO"
CREATE TEXT SEARCH CONFIGURATION (\fBCREATE_TEXT_SEARCH_CONFIGURATION\fR(7)), DROP TEXT SEARCH CONFIGURATION (\fBDROP_TEXT_SEARCH_CONFIGURATION\fR(7))