Actually, I expect the function looks like xmlquery(xmlcontent,xquery) and
return the query result.
So xmlconcat(xml1,xml2) become a good example to study.
starting from gram.y, I try to make parser to call xmlquery,the following is
the result of diff:
diff gram.y c:\new_gram.y
449c449
< XMLPI XMLQUERY XMLROOT XMLSERIALIZE
---
> XMLPI XMLROOT XMLSERIALIZE
8270,8273d8269
< | XMLQUERY '(' expr_list ')'
< {
< $$ = makeXmlExpr(IS_XMLQUERY, NULL,
NIL,$3);
< }
8287d8282
<
9296d9290
< | XMLQUERY
IS_XMLQUERY is added in primenodes.h
but the parser can not find xmlquery, the makeXmlExpr is not called at all.
thanks
2009/12/31 Robert Haas <[email protected]>
> On Thu, Dec 31, 2009 at 3:33 AM, fangfang liu <[email protected]>
> wrote:
> > Hi - Does anyone know how to add a xml support function into postgresql?
> >
> > I want to add a function named xmlquery into postgresql.
> >
> > I modify gram.y by adding xmlquery relatedcode wherever other xml support
> > functions appear.
> > but the parser can not find xmlquery, the makeXmlExpr is not called at
> all.
>
> How about CREATE OR REPLACE FUNCTION xmlquery(...) ?
>
> If that doesn't meet your needs, you'll need to explain what you're
> trying to do - and probably provide a patch showing what you've tried
> so far.
>
> ...Robert
>