[PATCH] Make ExplainBeginGroup()/ExplainEndGroup() public.

Started by Hadi Moshayediabout 9 years ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t37134
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 28, 2026 at 05:53 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t37134_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t37134_1 && git checkout t37134_1

Patchset v1 (message #1) is on t37134_1

Jump to latest
#1Hadi Moshayedi
hadi@citusdata.com

Hello,

The attached patch moves declarations of
ExplainBeginGroup()/ExplainEndGroup() from explain.c to explain.h.

This can be useful for extensions that need explain groups in their
custom-scan explain output.

For example, Citus uses groups in its custom explain outputs [1]https://github.com/citusdata/citus/blob/master/src/backend/distributed/planner/multi_explain.c. But it
achieves it by having a copy of
ExplainBeginGroup()/ExplainEndGroup() in its source code, which is not the
best way.

Please review.

[1]: https://github.com/citusdata/citus/blob/master/src/backend/distributed/planner/multi_explain.c
https://github.com/citusdata/citus/blob/master/src/backend/distributed/planner/multi_explain.c

Thanks,
Hadi

Attachments:

t37134_1
make_explainbeginendgroup_public.patchtext/x-patch; charset=US-ASCII; name=make_explainbeginendgroup_public.patchDownload+7-6
#2Hadi Moshayedi
hadi@citusdata.com
In reply to: Hadi Moshayedi (#1)
Re: [PATCH] Make ExplainBeginGroup()/ExplainEndGroup() public.

Title should have been "Make ExplainOpenGroup()/ExplainCloseGroup()
public.".

Sorry for the misspell.

#3Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Hadi Moshayedi (#1)
Re: [PATCH] Make ExplainBeginGroup()/ExplainEndGroup() public.

At Fri, 21 Jul 2017 10:09:25 -0400, Hadi Moshayedi <hadi@citusdata.com> wrote in <CA+_kT_cCew4OKqTL-ueNndEL1jWYu+3e9RdLZP-_WR1KbONzfA@mail.gmail.com>

Hello,

The attached patch moves declarations of
ExplainBeginGroup()/ExplainEndGroup() from explain.c to explain.h.

This can be useful for extensions that need explain groups in their
custom-scan explain output.

For example, Citus uses groups in its custom explain outputs [1]. But it
achieves it by having a copy of
ExplainBeginGroup()/ExplainEndGroup() in its source code, which is not the
best way.

Please review.

[1]
https://github.com/citusdata/citus/blob/master/src/backend/distributed/planner/multi_explain.c

The patch is a kind of straightforward and looks fine for me.

I think they ought to be public, like many ExplainProperty*()
functions. On the other hand this patch can cause symbol
conflicts with some external modules but I think such breakage
doesn't matter so much.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Robert Haas
robertmhaas@gmail.com
In reply to: Kyotaro Horiguchi (#3)
Re: [PATCH] Make ExplainBeginGroup()/ExplainEndGroup() public.

On Tue, Jul 25, 2017 at 9:54 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:

The patch is a kind of straightforward and looks fine for me.

+1 for this change.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#4)
Re: [PATCH] Make ExplainBeginGroup()/ExplainEndGroup() public.

Robert Haas <robertmhaas@gmail.com> writes:

On Tue, Jul 25, 2017 at 9:54 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:

The patch is a kind of straightforward and looks fine for me.

+1 for this change.

LGTM too, pushed.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers