forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit63d2ac2
committed
Undo double-quoting of index names in non-text EXPLAIN output formats.
explain_get_index_name() applied quote_identifier() to the index name.This is fine for text output, but the non-text output formats all havetheir own quoting conventions and would much rather start from theactual index name. For example in JSON you'd get something like "Index Name": "\"My Index\"",which is surely not desirable, especially when the same does nothappen for table names. Hence, move the responsibility for applyingquoting out to the callers, where it can go into already-existingspecial code paths for text format.This changes the API spec for users of explain_get_index_name_hook:before, they were supposed to apply quote_identifier() if necessary,now they should not. Research suggests that the only publiclyavailable user of the hook is hypopg, and it actually forgot toapply quoting anyway, so it's fine. (In any case, there's nobehavioral change for the output of a hook as seen in non-textEXPLAIN formats, so this won't break any case that programs shouldbe relying on.)Digging in the commit logs, it appears that quoting was included inexplain_get_index_name's duties when commit604ffd2 invented it;and that was fine at the time because we only had text output format.This should have been rethought when non-text formats were invented,but it wasn't.This is a fairly clear bug for users of non-text EXPLAIN formats,so back-patch to all supported branches.Per bug #16502 from Maciek Sakrejda. Patch by me (based oninvestigation by Euler Taveira); thanks to Julien Rouhaud for review.Discussion:https://postgr.es/m/16502-57bd1c9f913ed1d1@postgresql.org1 parentfe186b4 commit63d2ac2
1 file changed
+8
-4
lines changedLines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1456 | 1456 |
| |
1457 | 1457 |
| |
1458 | 1458 |
| |
1459 |
| - | |
| 1459 | + | |
| 1460 | + | |
1460 | 1461 |
| |
1461 | 1462 |
| |
1462 | 1463 |
| |
| |||
3267 | 3268 |
| |
3268 | 3269 |
| |
3269 | 3270 |
| |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
3270 | 3275 |
| |
3271 | 3276 |
| |
3272 | 3277 |
| |
| |||
3279 | 3284 |
| |
3280 | 3285 |
| |
3281 | 3286 |
| |
3282 |
| - | |
| 3287 | + | |
3283 | 3288 |
| |
3284 | 3289 |
| |
3285 | 3290 |
| |
3286 |
| - | |
3287 | 3291 |
| |
3288 | 3292 |
| |
3289 | 3293 |
| |
| |||
3463 | 3467 |
| |
3464 | 3468 |
| |
3465 | 3469 |
| |
3466 |
| - | |
| 3470 | + | |
3467 | 3471 |
| |
3468 | 3472 |
| |
3469 | 3473 |
| |
|
0 commit comments
Comments
(0)