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

2010-04-24 Thread Bruce Momjian
Robert Haas wrote: > On Sat, Apr 24, 2010 at 9:08 PM, Michael Tharp > wrote: > > 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.

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

2010-04-24 Thread Robert Haas
On Sat, Apr 24, 2010 at 9:08 PM, Michael Tharp wrote: > 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

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

2010-04-24 Thread Michael Tharp
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'

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

2010-04-24 Thread Tom Lane
Robert Haas writes: > On Sat, Apr 24, 2010 at 8:07 PM, Bruce Momjian wrote: >> Sounds useful to me, though as a function like suggested in a later >> email. > If tool-builders think this is useful, I have no problem with making > it available. It should be suitably disclaimed: "We reserve the r

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

2010-04-24 Thread Bruce Momjian
Added to TODO: Allow the parser output to be seen by clients This is useful for external tools. * http://archives.postgresql.org/pgsql-hackers/2010-04/msg00095.php --- Robert Haas wrote: > On Fri, Ap

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

2010-04-24 Thread Robert Haas
On Fri, Apr 2, 2010 at 3:53 PM, Michael Tharp wrote: > Most Esteemed Hackers: > > Due to popular demand on #postgresql (by which I mean David Fetter), I have > been spending a little time making the internal SQL parser available to > clients via a C-language SQL function. The function itself is ex

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

2010-04-24 Thread Robert Haas
On Sat, Apr 24, 2010 at 8:07 PM, Bruce Momjian wrote: > Jehan-Guillaume (ioguix) de Rorthais wrote: >> A simple example of a tokenizer is the php one: >>   http://fr.php.net/token_get_all >> >> And here is a basic example which return pseudo rows here : >> >> => TOKENIZE $script$ >>     SELECT 1;

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

2010-04-24 Thread Bruce Momjian
Jehan-Guillaume (ioguix) de Rorthais wrote: > A simple example of a tokenizer is the php one: > http://fr.php.net/token_get_all > > And here is a basic example which return pseudo rows here : > > => TOKENIZE $script$ > SELECT 1; > UPDATE test SET "a"=2; > $script$; > >type |

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

2010-04-21 Thread Pavel Stehule
2010/4/21 Jehan-Guillaume (ioguix) de Rorthais : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 04/04/2010 18:10, David Fetter wrote: >> On Sat, Apr 03, 2010 at 03:17:30PM +0200, Markus Schiltknecht wrote: >>> Hi, >>> >>> Michael Tharp wrote: I have been spending a little time making

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

2010-04-21 Thread Jehan-Guillaume (ioguix) de Rorthais
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/04/2010 18:10, David Fetter wrote: > On Sat, Apr 03, 2010 at 03:17:30PM +0200, Markus Schiltknecht wrote: >> Hi, >> >> Michael Tharp wrote: >>> I have been spending a little time making the internal SQL parser >>> available to clients via a C-lan

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

2010-04-04 Thread Michael Tharp
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 tell

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

2010-04-04 Thread David Fetter
On Sat, Apr 03, 2010 at 03:17:30PM +0200, Markus Schiltknecht wrote: > Hi, > > Michael Tharp wrote: > >I have been spending a little time making the internal SQL parser > >available to clients via a C-language SQL function. > > This sounds very much like one of the Cluster Features: > http://wiki

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

2010-04-03 Thread Markus Wanner
Hi, Michael Tharp wrote: I have been spending a little time making the internal SQL parser available to clients via a C-language SQL function. This sounds very much like one of the Cluster Features: http://wiki.postgresql.org/wiki/ClusterFeatures#API_into_the_Parser_.2F_Parser_as_an_independen

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

2010-04-02 Thread Tom Lane
Michael Tharp writes: > Due to popular demand on #postgresql (by which I mean David Fetter), I > have been spending a little time making the internal SQL parser > available to clients via a C-language SQL function. The function itself > is extremely simple: just a wrapper around a call to raw_p

[HACKERS] [RFC] nodeToString format and exporting the SQL parser

2010-04-02 Thread Michael Tharp
Most Esteemed Hackers: Due to popular demand on #postgresql (by which I mean David Fetter), I have been spending a little time making the internal SQL parser available to clients via a C-language SQL function. The function itself is extremely simple: just a wrapper around a call to raw_parser