Re: Invalid YAML output from EXPLAIN

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Invalid YAML output from EXPLAIN
Date: 2010-06-09 06:58:59
Message-ID: AANLkTim63I40z3UCIW1HtBsArlMcpSE4JcqvEGi37VCC@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 9 June 2010 03:48, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Er, I should also say, thanks for the report, and please test.  I am
> definitely not an expert on YAML.
>

I'm not an expert on YAML either, but I don't think this works (at
least it breaks against the online YAML parser here:
http://yaml-online-parser.appspot.com/). If the string starts with a
".", then it tries to treat it as a floating point number and baulks
if the rest of the string isn't a valid number.

Actually that gives me another argument for quoting *all* string
values: if a string value happens to be a valid number and we output
it unquoted, then parsers will treat is a number, forcing the user to
cast it to a string in their code. This is likely to lead to bugs in
user code, where things initially appear to work, then unexpectedly
start failing in pathalogical cases.

Personally, I'd also not try to escape keys at all. If in the future
we add a new key, then we'd be forced to choose between quoting it, or
more likely choosing a different key that doesn't require quoting,
which is what most people do in my (admittedly limited) experience.

In short, despite everything that's been said on this thread, I still
prefer my patch - but then I suppose I would say that :-)

Cheers,
Dean

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message p.buongiovanni 2010-06-09 07:14:56 Re: [BUGS] BUG #5492: Query performs slowly and sequence corrupted
Previous Message Mark Kirkwood 2010-06-09 05:41:50 Re: Bad optimizer data for xml (WAS: xml data type implications of no =)

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2010-06-09 07:14:04 Re: hstore ==> and deprecate =>
Previous Message Simon Riggs 2010-06-09 06:38:04 Re: Idea for getting rid of VACUUM FREEZE on cold pages