Prev: Show schema name on REINDEX DATABASE
Next: WIP patch for serializable transactions with predicate locking
From: Peter Eisentraut on 26 May 2010 12:41 On ons, 2010-05-26 at 11:47 +0100, Mike Fowler wrote: > > The XMLEXISTS function works with XQuery expressions and doesn't have > > the call signature that your patch implements > > Looking at the manuals of Oracle, Derby and DB2 I see how the call > signature differs. I also note that Oracle's implementation is XPath > only, Derby's is partial XQuery and DB2 appears to be full XQuery. > > What do people prefer me to do? I see the options as: > > 1) Change the call signature to match the standard > 2) Change the function name back to xpath_exists It would be nice to make XMLEXISTS work as in the standard, seeing how many others are providing the same interface. > Should option one be the more popular there's further choices: > > 1) Integrate XQuery support to completely match the standard, however > this will require the addition of a new library libxquery > 2) Leave the XPath as is, inline with Oracle's implementation > 3) Hybrid approach. Since XML is a comple time option, add XQuery as > another. Conditional completion gives the full XQuery support when > available or just the XPath when not I think providing XPath is enough, at least for now. -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: mike on 1 Jun 2010 12:06
Quoting Peter Eisentraut <peter_e(a)gmx.net>: > It would be nice to make XMLEXISTS work as in the standard, seeing how > many others are providing the same interface. > .... > > I think providing XPath is enough, at least for now. > Hi Peter, From piecing together sections 8.4 (<XML exists predicate>) and 6.18 (<XML query>), I believe the full call signature would be (apologies if my bracketing isn't right): XMLEXISTS ( xquery_expression [ PASSING {BY REF|BY VALUE} { (xml_expression [BY REF|BY VALUE]) | (xml_expression AS identifier) } [, ...] ] ) Seeing as we're only intereseted in XPath for the moment and most of the syntax above is only really relevant to XQuery, I would suggest the following as accepatable until full XQuery support comes: XMLEXISTS ( xpath_expression [ PASSING BY REF xml_expression [BY REF] ] ) There is one drawback in this approach, namely xml namespace support. I think borrowing the solution used in the xpath() (i.e. passing a nsarray) is out of the question as it won't be future proofed against full XQuery support. This is because the declaration of namespaces in XQuery is actually part of the query itself. I also think it inappropriate to attempt to parse the xpath_expression looking for XQuery style namespace declartions. So I think we ignore declared namespace support for the moment and just get the syntax correct ready for XQuery support in the hopefully near future. Do you agree with what I have proposed? Regards, -- Mike Fowler -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |