Re: add xml support function - Mailing list pgsql-hackers

From fangfang liu
Subject Re: add xml support function
Date
Msg-id 30acb4640912310322v301b9618p448b03429cbaec04@mail.gmail.com
Whole thread Raw
In response to Re: add xml support function  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: add xml support function  (Peter Eisentraut <peter_e@gmx.net>)
Re: add xml support function  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
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 <robertmhaas@gmail.com>
On Thu, Dec 31, 2009 at 3:33 AM, fangfang liu <yisuoyanyu888@gmail.com> 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

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Cancelling idle in transaction state
Next
From: Simon Riggs
Date:
Subject: Re: Hot Standy introduced problem with query cancel behavior