Passing tokens to a function

From: Scott Bailey <artacus(at)comcast(dot)net>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Passing tokens to a function
Date: 2009-05-22 07:09:53
Message-ID: 4A164FC1.5010303@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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, probably something more like:

SELECT *
FROM XMLTABLE('//node', xmldoc,
array[xt_column('id', INT, '@id'), xt_column('name', VARCHAR(30), 'name')])

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Harris 2009-05-22 07:48:44 Aggregate Function to return most common value for a column
Previous Message Tommy Gildseth 2009-05-22 07:09:32 Re: How to restore a SQL-ASCII encoded database to a new UTF-8 db?