Re: pg_overexplain produces invalid JSON with RANGE_TABLE option

amit <amitlangote09@gmail.com>

From: Amit Langote <amitlangote09@gmail.com>
To: SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-16T05:17:08Z
Lists: pgsql-hackers
On Thu, Apr 16, 2026 at 9:06 AM Amit Langote <amitlangote09@gmail.com> wrote:
> 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.

Pushed.

-- 
Thanks, Amit Langote



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix pg_overexplain to emit valid output with RANGE_TABLE option.