Andrew Dunstan <andrew@dunslane.net> writes:
> On 11/10/2011 04:29 PM, Robert Haas wrote:
>> 2011/11/10 ���������� ���������<tasosarvanitis@yahoo.gr>:
>>> Is there any other solution I am not aware of?
>> Not that I know of. I think pgAdmin can parse the EXPLAIN output,
>> too, but that's in C++.
> Pg--Explain is extremely well written, and should be easily translatable
> to Java if you really need to. The whole thing is less than 2000 lines,
> and a large part of that is comments.
Nonetheless, it's solving the wrong problem. Any program that is being
written today to read EXPLAIN output should be written to read one of
the machine-readable formats. If you insist on reading the text format,
don't be surprised when (not if) it breaks in future releases, and don't
expect any sympathy from these quarters.
It really shouldn't be that difficult to come by pre-fab code to read
at least one of XML, JSON, or YAML into a suitable data structure.
Now, if you're looking for something that "understands" the resulting
data structure in more than a superficial fashion, that's a different
question. But you'd need to get a lot more specific about what you
need it to do.
regards, tom lane