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 | pos |

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 br...@momjian.us 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 Robert Haas
On Fri, Apr 2, 2010 at 3:53 PM, Michael Tharp g...@partiallystapled.com 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

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,

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

2010-04-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sat, Apr 24, 2010 at 8:07 PM, Bruce Momjian br...@momjian.us 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

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

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 g...@partiallystapled.com 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

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 g...@partiallystapled.com 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

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-language SQL

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

2010-04-21 Thread Pavel Stehule
2010/4/21 Jehan-Guillaume (ioguix) de Rorthais iog...@free.fr: -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

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:

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 tells

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:

[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

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

2010-04-02 Thread Tom Lane
Michael Tharp g...@partiallystapled.com 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