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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Jehan-Guillaume (ioguix) de Rorthais" <ioguix(at)free(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org, David Fetter <david(at)fetter(dot)org>, Markus Wanner <markus(at)bluegap(dot)ch>, Michael Tharp <gxti(at)partiallystapled(dot)com>
Subject: Re: [RFC] nodeToString format and exporting the SQL parser
Date: 2010-04-25 00:07:06
Message-ID: 201004250007.o3P076K14630@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 | value | line
> - -------------+-----+----------+------
> SQL_COMMAND | 1 | 'SELECT' | 1
> CONSTANT | 8 | '1' | 1
> DELIMITER | 9 | ';' | 1
> SQL_COMMAND | 11 | 'UPDATE' | 2
> IDENTIFIER | 18 | 'test' | 2
> SQL_KEYWORD | 23 | 'SET' | 2
> IDENTIFIER | 27 | '"a"' | 2
> OPERATOR | 30 | '=' | 2
> CONSTANT | 31 | '1' | 2

Sounds useful to me, though as a function like suggested in a later
email.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-04-25 00:41:12 Re: [RFC] nodeToString format and exporting the SQL parser
Previous Message Bruce Momjian 2010-04-24 23:03:28 Re: [GENERAL] trouble with to_char('L')