I wrote: > Agreed as to the bug, but I think we ought to fix it by redefining > explain_get_index_name's API as "return the bare index name always", > and let the callers apply quoting.
Concretely, as attached.
I thought about that but decided to go the other way. I agree that mixing layers (get and format) is not a good idea.
I am unsure about back-patching this, but am leaning to doing so.
Extension authors can always add an ifdef to handle those cases if (s)he cares about it. Since this bug report did not come from an index-advisor extension user and that the code is like this for a decade, I bet that is safe to backpatch to all supported versions.