Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-09 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Robert Haas wrote: When I get some free time, I'll make a patch to implement as much of the spec as we sanely can. Saying that you'll fix it but not on any particular timetable is basically equivalent to saying that you're not willing to

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-09 Thread Robert Haas
On Wed, Jun 9, 2010 at 11:57 AM, Greg Sabino Mullane g...@turnstep.com wrote: The bug was only reported Monday morning, and you are yelling at me on a Tuesday night for not being willing to drop everything I'm doing and fix it right now? I am not saying and have not said that you needed to

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-08 Thread Florian Weimer
* Greg Smith: Florian Weimer wrote: It has been claimed before that YAML is a superset of JSON, so why can't the YAML folks use the existing JSON output instead? Because JSON just crosses the line where it feels like there's so much markup that people expect a tool is necessary to read

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-08 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 But YAML is not human-readable. There are human-readable subsets of it, but the general serializers do not produce them, and specific serializers are difficult to get right (as we've seen). No, it *is* human readable. Indeed, that's one of

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-08 Thread Robert Haas
On Tue, Jun 8, 2010 at 9:37 AM, Greg Sabino Mullane g...@turnstep.com wrote: When I get some free time, I'll make a patch to implement as much of the spec as we sanely can. Saying that you'll fix it but not on any particular timetable is basically equivalent to saying that you're not willing to

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Dean Rasheed wrote: ... So the current code in escape_yaml() is inadequate for producing valid YAML. I think it would have to also consider at least the following characters as special - : [ ] { } , \ ' | * . Technically, it would

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Tom Lane
Greg Sabino Mullane g...@turnstep.com writes: The rules should be: Requires quoting only if the first character: * ! |'% @ ` # Same as above, but no quoting if the second character is safe: - ? : Always requires quoting: :space space# aka ': ' ' #' Always

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Tom Lane wrote: ... Egad ... this is supposed to be an easily machine-generatable format? If it's really as broken as the above suggests, I think we should rip it out while we still can. Heh ... not like you to shrink from a challenge. ;)

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Robert Haas
On Mon, Jun 7, 2010 at 10:37 AM, Greg Sabino Mullane g...@turnstep.com wrote: Tom Lane wrote: I don't think the above would be particularly hard to implement myself, but if it becomes a really big deal, we can certainly punt by simply quoting anything containing an indicator (the special

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Andrew Dunstan
Robert Haas wrote: On Mon, Jun 7, 2010 at 10:37 AM, Greg Sabino Mullane g...@turnstep.com wrote: Tom Lane wrote: I don't think the above would be particularly hard to implement myself, but if it becomes a really big deal, we can certainly punt by simply quoting anything containing an

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Tom Lane
Greg Sabino Mullane g...@turnstep.com writes: I don't think the above would be particularly hard to implement myself, but if it becomes a really big deal, we can certainly punt by simply quoting anything containing an indicator (the special characters above). I would go with that. The

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Dean Rasheed
On 7 June 2010 15:56, Tom Lane t...@sss.pgh.pa.us wrote: Greg Sabino Mullane g...@turnstep.com writes: I don't think the above would be particularly hard to implement myself, but if it becomes a really big deal, we can certainly punt by simply quoting anything containing an indicator (the

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Florian Weimer
* Tom Lane: Egad ... this is supposed to be an easily machine-generatable format? Perhaps you could surround all strings with in the generator, and escape all potentially special characters (which seems to include some whitespace even in quoted strings, unfortunately)? It has been claimed

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Greg Smith
Florian Weimer wrote: It has been claimed before that YAML is a superset of JSON, so why can't the YAML folks use the existing JSON output instead? Because JSON just crosses the line where it feels like there's so much markup that people expect a tool is necessary to read it, which has

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Tom Lane
Greg Smith g...@2ndquadrant.com writes: The complaints about YAML taking up too much vertical space are understandable, but completely opposite of what I care about. I can e-mail a customer a YAML plan and it will survive to the other side and even in a reply back to me. Whereas any

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Josh Berkus
It's because of the potential for bugs in this area, that I'd propose just quoting everything (except numeric values) as in my original patch. I don't see a problem with this. I supported YAML output because I find it easier to read and copypaste than the other outputs. This is still the

Re: [HACKERS] [BUGS] Invalid YAML output from EXPLAIN

2010-06-07 Thread Greg Smith
Tom Lane wrote: This doesn't look amazingly unlike the current JSON output, and to the extent that we have to add more quoting to it, it's going to look even more like the JSON output. I don't know about that; here's the JSON one: EXPLAIN (FORMAT JSON) SELECT * FROM customers WHERE