Re: [RFC] nodeToString format and exporting the SQL parser - Mailing list pgsql-hackers

From Michael Tharp
Subject Re: [RFC] nodeToString format and exporting the SQL parser
Date
Msg-id 4BB8FAA1.1020507@partiallystapled.com
Whole thread Raw
In response to Re: [RFC] nodeToString format and exporting the SQL parser  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 04/02/2010 04:16 PM, Tom Lane wrote:
> Generally speaking I'm against
> exposing that data structure to clients, because there will inevitably
> be griping when we change it (as we most certainly will).  Your
> complaints boil down to "this is hard to parse from the client side",
> and that already tells me you're doing something that we will refuse
> to support.

Sorry, I got the impression that the node format was intended to be 
stable. If it's for internal use only then I don't suppose my 
suggestions make much sense.

As for the structure of the parse nodes themselves, changes aren't a big 
deal to me. What I'm doing is diffing entire files of DDL, so even if 
the node format changes over time the changes in two files parsed using 
the same code are still evident. In fact, the ambiguities in parsing 
don't really affect this use case much because I don't need exact values 
to detect changes.

Markus' link suggests using the parser for a load balancer, which would 
require that this all be in library form anyway as the balancer cannot 
afford a round trip to the server to parse the query, so maybe I should 
focus my efforts there. Making it a separate library would also resolve 
the compatibility issues as the library could keep its own structures 
regardless of where Postgres goes.

Thanks for the input!

-- m. tharp


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Nice hint on table aliasing!
Next
From: Tom Lane
Date:
Subject: Interesting near-bug in shared-dependency management