Re: [RFC] nodeToString format and exporting the SQL parser

From: Michael Tharp <gxti(at)partiallystapled(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [RFC] nodeToString format and exporting the SQL parser
Date: 2010-04-25 01:08:48
Message-ID: 4BD39620.6080101@partiallystapled.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/24/2010 08:49 PM, Robert Haas wrote:
>> The nodeToString format as it stands is somewhat ambiguous with respect to
>> the type of a node member's value if one does not have access to
>> readfuncs.c. For example, a T_BitString called foo is serialized as ':foo
>> b1010' while a char * containing 'b1010' is also serialized as ':foo b1010'.
>> This may just mean that _outToken needs to escape the leading 'b'. A similar
>> problem exists for booleans ('true' as a string vs. as a boolean).
>
> I am not inclined to change this. Turning the format into something
> self-describing seems to me to be significant work and a significant
> compatibility break for a very small amount of benefit.

The funny thing is, it doesn't seem to be a compatibility break because
the code in readfuncs.c that parses the node strings ignores the field
names entirely because it assumes they are in a particular order. It
also isn't much work to change the output because the code is, with the
exception of a few weirdos, all at the top of outfuncs.c, and the
weirdos are also dispersed within that file.

However, I'm no longer convinced that using a serialized node tree is
the way to go for my use case, nor am I particularly sure that it even
matches my use case at all anymore as I keep simplifying the goals as
time goes on. I won't be able to make any compelling arguments until I
figure out what I need :-)

Thanks for the feedback.

-- m. tharp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-04-25 01:14:44 Re: global temporary tables
Previous Message Tom Lane 2010-04-25 01:02:35 Re: [RFC] nodeToString format and exporting the SQL parser