Search Postgresql Archives

function to filter out tokens (sql syntax lexical)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hallo,

according to
http://www.postgresql.org/docs/8.4/interactive/sql-syntax-lexical.htm
A token can be a key word, an identifier, a quoted identifier, a literal
(or constant), or a special character symbol.

I suppose these different tokens are used by the internal parser?
So my questions is,
is there a function one could use to filter out the specific tokes?

Example:

Given the statement: INSERT INTO MY_TABLE VALUES (3, 'hi there');

We can do something like:

select filter_tokens($$INSERT INTO MY_TABLE VALUES (3, 'hi there');$$);

With output:

token 	| 	type
Insert		keyword
into		keyword
my_table	identifier
values		keyword
..
'hi there'	literal

or in another way with similar functionality?

mvg,
Wim


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux