Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1849b72

Browse files
committed
Fix wording in amvalidate error messages
Remove some gratuituous message differences by making the AM name previously embedded in each message be a %s instead. While at it, get rid of terminology that's unclear and unnecessary in one message. Discussion: https://postgr.es/m/[email protected]
1 parent 34782a3 commit 1849b72

File tree

6 files changed

+106
-106
lines changed

6 files changed

+106
-106
lines changed

src/backend/access/brin/brin_validate.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ brinvalidate(Oid opclassoid)
112112
{
113113
ereport(INFO,
114114
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
115-
errmsg("brin operator family \"%s\" contains function %s with invalid support number %d",
116-
opfamilyname,
115+
errmsg("operator family \"%s\" of access method %s contains function %s with invalid support number %d",
116+
opfamilyname, "brin",
117117
format_procedure(procform->amproc),
118118
procform->amprocnum)));
119119
result = false;
@@ -128,8 +128,8 @@ brinvalidate(Oid opclassoid)
128128
{
129129
ereport(INFO,
130130
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
131-
errmsg("brin operator family \"%s\" contains function %s with wrong signature for support number %d",
132-
opfamilyname,
131+
errmsg("operator family \"%s\" of access method %s contains function %s with wrong signature for support number %d",
132+
opfamilyname, "brin",
133133
format_procedure(procform->amproc),
134134
procform->amprocnum)));
135135
result = false;
@@ -150,8 +150,8 @@ brinvalidate(Oid opclassoid)
150150
{
151151
ereport(INFO,
152152
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
153-
errmsg("brin operator family \"%s\" contains operator %s with invalid strategy number %d",
154-
opfamilyname,
153+
errmsg("operator family \"%s\" of access method %s contains operator %s with invalid strategy number %d",
154+
opfamilyname, "brin",
155155
format_operator(oprform->amopopr),
156156
oprform->amopstrategy)));
157157
result = false;
@@ -179,8 +179,8 @@ brinvalidate(Oid opclassoid)
179179
{
180180
ereport(INFO,
181181
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
182-
errmsg("brin operator family \"%s\" contains invalid ORDER BY specification for operator %s",
183-
opfamilyname,
182+
errmsg("operator family \"%s\" of access method %s contains invalid ORDER BY specification for operator %s",
183+
opfamilyname, "brin",
184184
format_operator(oprform->amopopr))));
185185
result = false;
186186
}
@@ -192,8 +192,8 @@ brinvalidate(Oid opclassoid)
192192
{
193193
ereport(INFO,
194194
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
195-
errmsg("brin operator family \"%s\" contains operator %s with wrong signature",
196-
opfamilyname,
195+
errmsg("operator family \"%s\" of access method %s contains operator %s with wrong signature",
196+
opfamilyname, "brin",
197197
format_operator(oprform->amopopr))));
198198
result = false;
199199
}
@@ -230,8 +230,8 @@ brinvalidate(Oid opclassoid)
230230
{
231231
ereport(INFO,
232232
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
233-
errmsg("brin operator family \"%s\" is missing operator(s) for types %s and %s",
234-
opfamilyname,
233+
errmsg("operator family \"%s\" of access method %s is missing operator(s) for types %s and %s",
234+
opfamilyname, "brin",
235235
format_type_be(thisgroup->lefttype),
236236
format_type_be(thisgroup->righttype))));
237237
result = false;
@@ -240,8 +240,8 @@ brinvalidate(Oid opclassoid)
240240
{
241241
ereport(INFO,
242242
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
243-
errmsg("brin operator family \"%s\" is missing support function(s) for types %s and %s",
244-
opfamilyname,
243+
errmsg("operator family \"%s\" of access method %s is missing support function(s) for types %s and %s",
244+
opfamilyname, "brin",
245245
format_type_be(thisgroup->lefttype),
246246
format_type_be(thisgroup->righttype))));
247247
result = false;
@@ -253,8 +253,8 @@ brinvalidate(Oid opclassoid)
253253
{
254254
ereport(INFO,
255255
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
256-
errmsg("brin operator class \"%s\" is missing operator(s)",
257-
opclassname)));
256+
errmsg("operator class \"%s\" of access method %s is missing operator(s)",
257+
opclassname, "brin")));
258258
result = false;
259259
}
260260
for (i = 1; i <= BRIN_MANDATORY_NPROCS; i++)
@@ -264,8 +264,8 @@ brinvalidate(Oid opclassoid)
264264
continue; /* got it */
265265
ereport(INFO,
266266
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
267-
errmsg("brin operator class \"%s\" is missing support function %d",
268-
opclassname, i)));
267+
errmsg("operator class \"%s\" of access method %s is missing support function %d",
268+
opclassname, "brin", i)));
269269
result = false;
270270
}
271271

src/backend/access/gin/ginvalidate.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ ginvalidate(Oid opclassoid)
8989
{
9090
ereport(INFO,
9191
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
92-
errmsg("gin operator family \"%s\" contains support procedure %s with cross-type registration",
93-
opfamilyname,
92+
errmsg("operator family \"%s\" of access method %s contains support procedure %s with different left and right input types",
93+
opfamilyname, "gin",
9494
format_procedure(procform->amproc))));
9595
result = false;
9696
}
@@ -145,8 +145,8 @@ ginvalidate(Oid opclassoid)
145145
default:
146146
ereport(INFO,
147147
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
148-
errmsg("gin operator family \"%s\" contains function %s with invalid support number %d",
149-
opfamilyname,
148+
errmsg("operator family \"%s\" of access method %s contains function %s with invalid support number %d",
149+
opfamilyname, "gin",
150150
format_procedure(procform->amproc),
151151
procform->amprocnum)));
152152
result = false;
@@ -157,8 +157,8 @@ ginvalidate(Oid opclassoid)
157157
{
158158
ereport(INFO,
159159
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
160-
errmsg("gin operator family \"%s\" contains function %s with wrong signature for support number %d",
161-
opfamilyname,
160+
errmsg("operator family \"%s\" of access method %s contains function %s with wrong signature for support number %d",
161+
opfamilyname, "gin",
162162
format_procedure(procform->amproc),
163163
procform->amprocnum)));
164164
result = false;
@@ -176,8 +176,8 @@ ginvalidate(Oid opclassoid)
176176
{
177177
ereport(INFO,
178178
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
179-
errmsg("gin operator family \"%s\" contains operator %s with invalid strategy number %d",
180-
opfamilyname,
179+
errmsg("operator family \"%s\" of access method %s contains operator %s with invalid strategy number %d",
180+
opfamilyname, "gin",
181181
format_operator(oprform->amopopr),
182182
oprform->amopstrategy)));
183183
result = false;
@@ -189,8 +189,8 @@ ginvalidate(Oid opclassoid)
189189
{
190190
ereport(INFO,
191191
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
192-
errmsg("gin operator family \"%s\" contains invalid ORDER BY specification for operator %s",
193-
opfamilyname,
192+
errmsg("operator family \"%s\" of access method %s contains invalid ORDER BY specification for operator %s",
193+
opfamilyname, "gin",
194194
format_operator(oprform->amopopr))));
195195
result = false;
196196
}
@@ -202,8 +202,8 @@ ginvalidate(Oid opclassoid)
202202
{
203203
ereport(INFO,
204204
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
205-
errmsg("gin operator family \"%s\" contains operator %s with wrong signature",
206-
opfamilyname,
205+
errmsg("operator family \"%s\" of access method %s contains operator %s with wrong signature",
206+
opfamilyname, "gin",
207207
format_operator(oprform->amopopr))));
208208
result = false;
209209
}
@@ -243,8 +243,8 @@ ginvalidate(Oid opclassoid)
243243
continue; /* don't need both, see check below loop */
244244
ereport(INFO,
245245
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
246-
errmsg("gin operator class \"%s\" is missing support function %d",
247-
opclassname, i)));
246+
errmsg("operator class \"%s\" of access method %s is missing support function %d",
247+
opclassname, "gin", i)));
248248
result = false;
249249
}
250250
if (!opclassgroup ||
@@ -253,8 +253,8 @@ ginvalidate(Oid opclassoid)
253253
{
254254
ereport(INFO,
255255
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
256-
errmsg("gin operator class \"%s\" is missing support function %d or %d",
257-
opclassname,
256+
errmsg("operator class \"%s\" of access method %s is missing support function %d or %d",
257+
opclassname, "gin",
258258
GIN_CONSISTENT_PROC, GIN_TRICONSISTENT_PROC)));
259259
result = false;
260260
}

src/backend/access/gist/gistvalidate.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ gistvalidate(Oid opclassoid)
8989
{
9090
ereport(INFO,
9191
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
92-
errmsg("gist operator family \"%s\" contains support procedure %s with cross-type registration",
93-
opfamilyname,
92+
errmsg("operator family \"%s\" of access method %s contains support procedure %s with different left and right input types",
93+
opfamilyname, "gist",
9494
format_procedure(procform->amproc))));
9595
result = false;
9696
}
@@ -142,8 +142,8 @@ gistvalidate(Oid opclassoid)
142142
default:
143143
ereport(INFO,
144144
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
145-
errmsg("gist operator family \"%s\" contains function %s with invalid support number %d",
146-
opfamilyname,
145+
errmsg("operator family \"%s\" of access method %s contains function %s with invalid support number %d",
146+
opfamilyname, "gist",
147147
format_procedure(procform->amproc),
148148
procform->amprocnum)));
149149
result = false;
@@ -154,8 +154,8 @@ gistvalidate(Oid opclassoid)
154154
{
155155
ereport(INFO,
156156
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
157-
errmsg("gist operator family \"%s\" contains function %s with wrong signature for support number %d",
158-
opfamilyname,
157+
errmsg("operator family \"%s\" of access method %s contains function %s with wrong signature for support number %d",
158+
opfamilyname, "gist",
159159
format_procedure(procform->amproc),
160160
procform->amprocnum)));
161161
result = false;
@@ -174,8 +174,8 @@ gistvalidate(Oid opclassoid)
174174
{
175175
ereport(INFO,
176176
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
177-
errmsg("gist operator family \"%s\" contains operator %s with invalid strategy number %d",
178-
opfamilyname,
177+
errmsg("operator family \"%s\" of access method %s contains operator %s with invalid strategy number %d",
178+
opfamilyname, "gist",
179179
format_operator(oprform->amopopr),
180180
oprform->amopstrategy)));
181181
result = false;
@@ -192,8 +192,8 @@ gistvalidate(Oid opclassoid)
192192
{
193193
ereport(INFO,
194194
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
195-
errmsg("gist operator family \"%s\" contains unsupported ORDER BY specification for operator %s",
196-
opfamilyname,
195+
errmsg("operator family \"%s\" of access method %s contains unsupported ORDER BY specification for operator %s",
196+
opfamilyname, "gist",
197197
format_operator(oprform->amopopr))));
198198
result = false;
199199
}
@@ -203,8 +203,8 @@ gistvalidate(Oid opclassoid)
203203
{
204204
ereport(INFO,
205205
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
206-
errmsg("gist operator family \"%s\" contains incorrect ORDER BY opfamily specification for operator %s",
207-
opfamilyname,
206+
errmsg("operator family \"%s\" of access method %s contains incorrect ORDER BY opfamily specification for operator %s",
207+
opfamilyname, "gist",
208208
format_operator(oprform->amopopr))));
209209
result = false;
210210
}
@@ -222,8 +222,8 @@ gistvalidate(Oid opclassoid)
222222
{
223223
ereport(INFO,
224224
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
225-
errmsg("gist operator family \"%s\" contains operator %s with wrong signature",
226-
opfamilyname,
225+
errmsg("operator family \"%s\" of access method %s contains operator %s with wrong signature",
226+
opfamilyname, "gist",
227227
format_operator(oprform->amopopr))));
228228
result = false;
229229
}
@@ -261,8 +261,8 @@ gistvalidate(Oid opclassoid)
261261
continue; /* optional methods */
262262
ereport(INFO,
263263
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
264-
errmsg("gist operator class \"%s\" is missing support function %d",
265-
opclassname, i)));
264+
errmsg("operator class \"%s\" of access method %s is missing support function %d",
265+
opclassname, "gist", i)));
266266
result = false;
267267
}
268268

src/backend/access/hash/hashvalidate.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ hashvalidate(Oid opclassoid)
9595
{
9696
ereport(INFO,
9797
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
98-
errmsg("hash operator family \"%s\" contains support procedure %s with cross-type registration",
99-
opfamilyname,
98+
errmsg("operator family \"%s\" of access method %s contains support procedure %s with different left and right input types",
99+
opfamilyname, "hash",
100100
format_procedure(procform->amproc))));
101101
result = false;
102102
}
@@ -110,8 +110,8 @@ hashvalidate(Oid opclassoid)
110110
{
111111
ereport(INFO,
112112
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
113-
errmsg("hash operator family \"%s\" contains function %s with wrong signature for support number %d",
114-
opfamilyname,
113+
errmsg("operator family \"%s\" of access method %s contains function %s with wrong signature for support number %d",
114+
opfamilyname, "hash",
115115
format_procedure(procform->amproc),
116116
procform->amprocnum)));
117117
result = false;
@@ -127,8 +127,8 @@ hashvalidate(Oid opclassoid)
127127
default:
128128
ereport(INFO,
129129
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
130-
errmsg("hash operator family \"%s\" contains function %s with invalid support number %d",
131-
opfamilyname,
130+
errmsg("operator family \"%s\" of access method %s contains function %s with invalid support number %d",
131+
opfamilyname, "hash",
132132
format_procedure(procform->amproc),
133133
procform->amprocnum)));
134134
result = false;
@@ -148,8 +148,8 @@ hashvalidate(Oid opclassoid)
148148
{
149149
ereport(INFO,
150150
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
151-
errmsg("hash operator family \"%s\" contains operator %s with invalid strategy number %d",
152-
opfamilyname,
151+
errmsg("operator family \"%s\" of access method %s contains operator %s with invalid strategy number %d",
152+
opfamilyname, "hash",
153153
format_operator(oprform->amopopr),
154154
oprform->amopstrategy)));
155155
result = false;
@@ -161,8 +161,8 @@ hashvalidate(Oid opclassoid)
161161
{
162162
ereport(INFO,
163163
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
164-
errmsg("hash operator family \"%s\" contains invalid ORDER BY specification for operator %s",
165-
opfamilyname,
164+
errmsg("operator family \"%s\" of access method %s contains invalid ORDER BY specification for operator %s",
165+
opfamilyname, "hash",
166166
format_operator(oprform->amopopr))));
167167
result = false;
168168
}
@@ -174,8 +174,8 @@ hashvalidate(Oid opclassoid)
174174
{
175175
ereport(INFO,
176176
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
177-
errmsg("hash operator family \"%s\" contains operator %s with wrong signature",
178-
opfamilyname,
177+
errmsg("operator family \"%s\" of access method %s contains operator %s with wrong signature",
178+
opfamilyname, "hash",
179179
format_operator(oprform->amopopr))));
180180
result = false;
181181
}
@@ -186,8 +186,8 @@ hashvalidate(Oid opclassoid)
186186
{
187187
ereport(INFO,
188188
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
189-
errmsg("hash operator family \"%s\" lacks support function for operator %s",
190-
opfamilyname,
189+
errmsg("operator family \"%s\" of access method %s lacks support function for operator %s",
190+
opfamilyname, "hash",
191191
format_operator(oprform->amopopr))));
192192
result = false;
193193
}
@@ -214,8 +214,8 @@ hashvalidate(Oid opclassoid)
214214
{
215215
ereport(INFO,
216216
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
217-
errmsg("hash operator family \"%s\" is missing operator(s) for types %s and %s",
218-
opfamilyname,
217+
errmsg("operator family \"%s\" of access method %s is missing operator(s) for types %s and %s",
218+
opfamilyname, "hash",
219219
format_type_be(thisgroup->lefttype),
220220
format_type_be(thisgroup->righttype))));
221221
result = false;
@@ -228,8 +228,8 @@ hashvalidate(Oid opclassoid)
228228
{
229229
ereport(INFO,
230230
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
231-
errmsg("hash operator class \"%s\" is missing operator(s)",
232-
opclassname)));
231+
errmsg("operator class \"%s\" of access method %s is missing operator(s)",
232+
opclassname, "hash")));
233233
result = false;
234234
}
235235

@@ -244,8 +244,8 @@ hashvalidate(Oid opclassoid)
244244
{
245245
ereport(INFO,
246246
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
247-
errmsg("hash operator family \"%s\" is missing cross-type operator(s)",
248-
opfamilyname)));
247+
errmsg("operator family \"%s\" of access method %s is missing cross-type operator(s)",
248+
opfamilyname, "hash")));
249249
result = false;
250250
}
251251

0 commit comments

Comments
 (0)