forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbd2d3c9
committed
pgstattuple: Fix failure with pgstathashindex() for partitioned indexes
As coded, the function relied on index_open() when opening an indexrelation, allowing partitioned indexes to be processed bypgstathashindex(). This was leading to a "could not open file" errorbecause partitioned indexes have no physical files, or to a crash withan assertion failure (like on HEAD).This issue is fixed by applying the same checks as the other statfunctions for indexes, with a lookup at both RELKIND_INDEX and the indexAM expected.Author: Alexander LakhinDiscussion:https://postgr.es/m/18246-f4d9ff7cb3af77e6@postgresql.orgBackpatch-through: 121 parent499342e commitbd2d3c9
File tree
3 files changed
+11
-7
lines changed- contrib/pgstattuple
- expected
- sql
3 files changed
+11
-7
lines changedLines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
| 156 | + | |
156 | 157 |
| |
157 | 158 |
| |
158 | 159 |
| |
| |||
167 | 168 |
| |
168 | 169 |
| |
169 | 170 |
| |
170 |
| - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
171 | 174 |
| |
172 | 175 |
| |
173 | 176 |
| |
| |||
181 | 184 |
| |
182 | 185 |
| |
183 | 186 |
| |
184 |
| - | |
| 187 | + | |
185 | 188 |
| |
186 | 189 |
| |
187 | 190 |
| |
| |||
197 | 200 |
| |
198 | 201 |
| |
199 | 202 |
| |
200 |
| - | |
| 203 | + | |
201 | 204 |
| |
202 | 205 |
| |
203 | 206 |
| |
| |||
224 | 227 |
| |
225 | 228 |
| |
226 | 229 |
| |
227 |
| - | |
| 230 | + | |
228 | 231 |
| |
229 | 232 |
| |
230 | 233 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
615 | 615 |
| |
616 | 616 |
| |
617 | 617 |
| |
618 |
| - | |
| 618 | + | |
619 | 619 |
| |
620 |
| - | |
621 |
| - | |
| 620 | + | |
622 | 621 |
| |
623 | 622 |
| |
624 | 623 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| 68 | + | |
68 | 69 |
| |
69 | 70 |
| |
70 | 71 |
| |
| |||
73 | 74 |
| |
74 | 75 |
| |
75 | 76 |
| |
| 77 | + | |
76 | 78 |
| |
77 | 79 |
| |
78 | 80 |
| |
|
0 commit comments
Comments
(0)