Re: pg_overexplain produces invalid JSON with RANGE_TABLE option

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_overexplain produces invalid JSON with RANGE_TABLE option
Date: 2026-04-16 00:06:21
Message-ID: CA+HiwqFMboUmHtoGjpLfNAWKitjA4T=jnfca9QrYvoBWrrmY0g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Apr 16, 2026 at 6:36 AM SATYANARAYANA NARLAPURAM
<satyanarlapuram(at)gmail(dot)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 Content-Type Size
v1-0001-Fix-pg_overexplain-to-emit-valid-output-with-RANG.patch application/octet-stream 12.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-04-16 00:13:42 Re: Support EXCEPT for TABLES IN SCHEMA publications
Previous Message Paul A Jungwirth 2026-04-15 23:25:58 Re: SQL:2011 Application Time Update & Delete