Re: Passing tokens to a function - Mailing list pgsql-general

From Tom Lane
Subject Re: Passing tokens to a function
Date
Msg-id 27947.1243014569@sss.pgh.pa.us
Whole thread Raw
In response to Passing tokens to a function  (Scott Bailey <artacus@comcast.net>)
List pgsql-general
Scott Bailey <artacus@comcast.net> writes:
> I'd like to make an XMLTABLE() function, probably in plpython (not C).
> And I'd like to follow the SQL/XML standard. So a function call should
> look something like this:

> SELECT *
> FROM XMLTABLE('//node'
>    PASSING xmldoc
>    COLUMNS id INT PATH '@id',
>      name VARCHAR(30) PATH 'name')

> Is this possible to pass in the tokens or do I need to abandon the
> standard and just take parameters,

The latter, unless you want to modify the parser (see gram.y).

The SQL committee's willingness to invent random syntax like this
is not one of their better habits :-(

            regards, tom lane

pgsql-general by date:

Previous
From: Alex Thurlow
Date:
Subject: Re: Tuning resource parameters for a logging database.
Next
From: Konstantin Izmailov
Date:
Subject: question about SSIS