Re: BUG #16171: Potential malformed JSON in explain output

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hamid Akhtar <hamid(dot)akhtar(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16171: Potential malformed JSON in explain output
Date: 2020-02-02 12:08:07
Message-ID: 5217695A-8776-4F59-823A-B391DCA1F601@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

> On 1 Feb 2020, at 20:37, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Hamid Akhtar <hamid(dot)akhtar(at)gmail(dot)com> writes:
>> I've reviewed and verified this patch and IMHO, this is ready to be committed.
>
> I took a look at this and I don't think it's really going in the right
> direction. ISTM the clear intent of this code was to attach the "Subplans
> Removed" item as a field of the parent [Merge]Append node, but the author
> forgot about the intermediate "Plans" array. So I think that, rather than
> doubling down on a mistake, we ought to move where the field is generated
> so that it *is* a field of the parent node.

Right, that makes sense; +1 on the attached 0001 patch.

> This does lead to some field
> order rearrangement in text mode, as per the regression test changes,
> but I think that's not a big deal. (A change can only happen if there
> are initplan(s) attached to the parent node.)

Does that prevent backpatching this, or are we Ok with EXPLAIN text output not
being stable across minors? AFAICT Pg::Explain still works fine with this
change, but mileage may vary for other parsers.

> 0002 attached isn't committable, because nobody would want the overhead
> in production, but it seems like a good trick to keep up our sleeves.

Thats a neat trick, I wonder if it would be worth maintaining a curated list of
these tricks in a README under src/test to help others avoid/reduce wheel
reinventing?

cheers ./daniel

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-02-02 16:48:32 Re: BUG #16171: Potential malformed JSON in explain output
Previous Message Jack Plasterer 2020-02-01 21:33:41 Unable to trigger createdb

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2020-02-02 16:17:18 ALTER tbl rewrite loses CLUSTER ON index
Previous Message Pierre Ducroquet 2020-02-02 09:59:32 Re: PATCH: add support for IN and @> in functional-dependency statistics use