Invalid explain output for multi-plan statements

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Invalid explain output for multi-plan statements
Date: 2009-12-14 17:32:01
Message-ID: e46a13da36697d0b83e837b4678437f7@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

The new explain formats break if you have a multi-query statement.
I don't have time to fix at the moment, but I'll try and explain
the problem. For YAML, the forced leading space in all output
means that the first "- Plan:" has two spaces, and all other ones
have a single space. This leads to an inconsistent indentation
error when parsing. For JSON, I'm not sure where the exact problem
lies, but it also will not parse as it produces something like this:

[
{
...plan 1
},,
{
...plan2
}
]

The XML output looks valid, but I've not tried to parse it.

To duplicate:

CREATE TABLE abc(a int);
INSERT INTO abc VALUES (1);
CREATE TABLE def(a int);
CREATE RULE foo AS ON UPDATE TO abc DO ALSO SELECT 1 FROM def;

EXPLAIN (format YAML) UPDATE abc SET a=a;
EXPLAIN (format JSON) UPDATE abc SET a=a;
EXPLAIN (format XML) UPDATE abc SET a=a;

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation
PGP Key: 0x14964AC8 200912141230
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAksmdisACgkQvJuQZxSWSsjaZACfeErCQbAU3a4DK3WqNBCaQMPI
oe8AoKDsP+bIvsV2e2qD/Jx1NhrQw4ui
=5lky
-----END PGP SIGNATURE-----

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2009-12-14 17:59:35 Re: Invalid explain output for multi-plan statements
Previous Message Tom Lane 2009-12-14 17:25:44 Re: BUG #5238: frequent signal 11 segfaults