On Tue, Aug 1, 2017 at 12:35 PM, Remi Colinet <remi.colinet@gmail.com> wrote: > I did it in version 2 of the patch. > I'am skeptical about the use of JSON, XML, and others in such output. > > Does anyone use these formats (XML, JSON, YAML) for EXPLAIN output? > I suspect only TEXT format is being used.
Do you have any reason to suspect that others aren't being used? The default format for anything is likely to be the most commonly-used one, but I don't think that proves the others are unused.
Even if it were true, it wouldn't be a good justification for inventing an entirely new machine-readable format, at least not IMHO.
In version 3, my idea was to use a similar output as the one used for Ora..e database with the v$session_longops dynamic table.
May be this is not such a good idea then. Though, it seems very handy at 1st sight.
I can revert to TEXT, JSON, XML and YAML. I will need to modify EXPLAIN code in order to share some common parts for output formatting. Basically, this would not change the code of EXPLAIN unless than moving some functions in a pg_report.c file and with function names starting by ReportXXX instead of ExplainXXX . Duplicating code for such output is not an option.