Re: bug: json format and auto_explain - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bug: json format and auto_explain
Date
Msg-id 5029.1260202063@sss.pgh.pa.us
Whole thread Raw
In response to Re: bug: json format and auto_explain  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: bug: json format and auto_explain  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Looks like auto_explain is under the illusion that it need not call
>> ExplainBeginOutput/ExplainEndOutput.

> Explain{Begin/End}Output are static functions, so we cannot call them
> from an external contrib module. Instead, I'll suggest to call them
> automatically from ExplainPrintPlan. The original codes in ExplainPrintPlan
> was moved into ExplainOneResult, that name might be debatable.

This isn't an adequate solution I'm afraid --- what about the other
functions that are exported by explain.h?

I too am not totally thrilled with the idea of exporting
Explain{Begin/End}Output, but it might be the best solution.
We might also need to think about refactoring those functions:
there seem to be two different things going on there, one being
format-specific initialization which will certainly be necessary,
and one being output of a wrapper structure which might or might
not be appropriate for what auto_explain or other callers want.

In any case you need to expend more effort on the comments for the
functions.  Inadequate specification of ExplainPrintPlan's call
requirements is what got us into this problem in the first place,
and the proposed patch makes that worse not better.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Re: bug: json format and auto_explain
Next
From: Alvaro Herrera
Date:
Subject: Re: Adding support for SE-Linux security