Re: BUG #16502: EXPLAIN JSON format adds extra quotes around index names

From: Euler Taveira <euler(dot)taveira(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, m(dot)sakrejda(at)gmail(dot)com
Subject: Re: BUG #16502: EXPLAIN JSON format adds extra quotes around index names
Date: 2020-06-20 23:15:40
Message-ID: CAH503wBzp3eHhZxTWPMA7rTBsWN2cXYXjB_JLWoqZOfu2x=KXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, 20 Jun 2020 at 19:11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> 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.

BTW, your patch looks good to me.

--
Euler Taveira http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maciek Sakrejda 2020-06-21 02:35:16 Re: BUG #16502: EXPLAIN JSON format adds extra quotes around index names
Previous Message Tom Lane 2020-06-20 22:11:09 Re: BUG #16502: EXPLAIN JSON format adds extra quotes around index names