Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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: yet_another_yaml_fix.patch
Description: application/octet-stream (2.8 KB)

In response to

Responses

pgsql-hackers by date

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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group