Re: pg_overexplain produces invalid JSON with RANGE_TABLE option - Mailing list pgsql-hackers

From Amit Langote
Subject Re: pg_overexplain produces invalid JSON with RANGE_TABLE option
Date
Msg-id CA+HiwqFMboUmHtoGjpLfNAWKitjA4T=jnfca9QrYvoBWrrmY0g@mail.gmail.com
Whole thread
In response to pg_overexplain produces invalid JSON with RANGE_TABLE option  (SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>)
Responses Re: pg_overexplain produces invalid JSON with RANGE_TABLE option
Re: pg_overexplain produces invalid JSON with RANGE_TABLE option
List pgsql-hackers
Hi,

On Thu, Apr 16, 2026 at 6:36 AM SATYANARAYANA NARLAPURAM
<satyanarlapuram@gmail.com> wrote:
>
> Hi Hackers,
>
> It appears that pg_overexplain produces invalid JSON output when
> EXPLAIN (FORMAT JSON, RANGE_TABLE) is used. The "Unprunable RTIs" and
> "Result RTIs" properties are emitted as key:value pairs directly inside
> the "Range Table" JSON array, which is structurally invalid.

Thanks for the report and the patch.  That makes sense.

> Attempted to fix this by moving ExplainCloseGroup() before the two overexplain_bitmapset()
> calls, so the properties are emitted as siblings of "Range Table" in the parent object rather
> than inside the array.
>
> Attached a patch to address this which also includes a test.

I have added a commit message.  Will commit shortly to master and v18.

--
Thanks, Amit Langote

Attachment

pgsql-hackers by date:

Previous
From: Paul A Jungwirth
Date:
Subject: Re: SQL:2011 Application Time Update & Delete
Next
From: Peter Smith
Date:
Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications