Re: Invalid YAML output from EXPLAIN

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

On Wed, Jun 9, 2010 at 9:35 AM, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
>>> Does anyone care that Alias will sometimes be a string, and sometimes a number?
>> I guess we could do this by (a) conditionalizing the YAML case in
>> ExplainProperty() in the same way that the JSON case is currently
>> conditionalized, and (b) changing the first if statement in
>> escape_yaml() to set needs_quoting = true unless the first character
>> is alphabetic or an underscore.
> Yes, I think that would do it.

After further review, it appears to me that this change is pretty much
required, because otherwise a string like 0xa won't be quoted. I
might think it's OK for "123" to turn into 123, but I'm not going to
be so happy about "0xa" turning into 10. Please test the attached
patch.

>> By the way, can I ask why you're not just using the JSON format for
>> this?  I mean, I'm glad you are, because it exposed a bug that we got
>> fixed before release, but it seems a little masochistic...!
>
> Actually I doubt that I will use this feature at all! I only use
> EXPLAIN from psql, and usually I'm the only one who needs to read it,
> so the TEXT format will remain my preferred option.
>
> I was just doing some random beta testing, working through the list of
> cool new features.

Quick, somebody give this man a cigar!

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

Attachment Content-Type Size
yet_another_yaml_fix.patch application/octet-stream 2.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-06-09 14:50:47 Re: BUG #5475: Problem during Instalation
Previous Message Heikki Linnakangas 2010-06-09 14:38:56 Re: [BUGS] Server crash while trying to read expression using pg_get_expr()

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-06-09 15:03:17 Re: Invalid YAML output from EXPLAIN
Previous Message Tom Lane 2010-06-09 14:41:25 Re: failover vs. read only queries