- Notifications
You must be signed in to change notification settings - Fork5k
Commit88a658a
committed
amcheck: Improve error message for partitioned index target.
Previously, amcheck could produce misleading error message whena partitioned index was passed to functions like bt_index_check().For example, bt_index_check() with a partitioned btree index produced: ERROR: expected "btree" index as targets for verification DETAIL: Relation ... is a btree index.Reporting "expected btree index as targets" even when the specifiedindex was a btree was confusing. In this case, the function should failsince the partitioned index specified is not valid target. This commitimproves the error reporting to better reflect this actual issue. Now,bt_index_check() with a partitioned index, the error message is: ERROR: expected index as targets for verification DETAIL: This operation is not supported for partitioned indexes.This commit also applies the following minor changes:- Simplifies index_checkable() by using get_am_name() to retrieve the access method name.- Changes index_checkable() from extern to static, as it is only used in verify_common.c.- Updates the error code for invalid indexes to ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE, aligning with usage in similar modules like pgstattuple.Author: Masahiro Ikeda <ikedamsh@oss.nttdata.com>Reviewed-by: Fujii Masao <masao.fujii@gmail.com>Discussion:https://postgr.es/m/8829854bbfc8635ddecd0846bb72dfda@oss.nttdata.com1 parent6b1c4d3 commit88a658a
File tree
4 files changed
+27
-14
lines changed- contrib/amcheck
- expected
- sql
4 files changed
+27
-14
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 |
| |
64 | 72 |
| |
65 | 73 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
55 | 62 |
| |
56 | 63 |
| |
57 | 64 |
| |
|
Lines changed: 12 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| 27 | + | |
26 | 28 |
| |
27 | 29 |
| |
28 | 30 |
| |
| |||
155 | 157 |
| |
156 | 158 |
| |
157 | 159 |
| |
158 |
| - | |
| 160 | + | |
159 | 161 |
| |
160 | 162 |
| |
161 |
| - | |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
166 | 168 |
| |
167 |
| - | |
168 |
| - | |
| 169 | + | |
169 | 170 |
| |
170 | 171 |
| |
171 |
| - | |
| 172 | + | |
172 | 173 |
| |
173 |
| - | |
174 |
| - | |
| 174 | + | |
175 | 175 |
| |
176 | 176 |
| |
177 | 177 |
| |
| |||
182 | 182 |
| |
183 | 183 |
| |
184 | 184 |
| |
185 |
| - | |
| 185 | + | |
186 | 186 |
| |
187 | 187 |
| |
188 | 188 |
| |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
30 |
| - |
0 commit comments
Comments
(0)