Re: Adding xpath_exists function

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Mike Fowler <mike(at)mlfowler(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding xpath_exists function
Date: 2010-05-06 15:43:09
Message-ID: AANLkTimMqQkPbkXHlQ53odsbme1Ev3aS9KKAPsFvdQEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-rrreviewers

On Thu, May 6, 2010 at 10:10 AM, Mike Fowler <mike(at)mlfowler(dot)com> wrote:
> Hi hackers,
>
> Although this is a very small change I figured I'd practice the policy of
> outlining your change before you write the code and attempt a patch
> submission. Essentially I see the function as a convenience function that
> exposes the results of the xpath built in exists() function as a boolean for
> easier SQL. The syntax will match the xpath function already present:
>
> xpath_exists(xpath, xml[, nsarray])
>
> The implementation will check that the xpath value contains 'exists(.....)'
> and add it if not present for added usability. I can't blindly wrap the
> value with exists(...) as exists(exists(.....)) will always return true in
> xpath. I've not allocated the oid yet, but will try to earn my bonus points
> for getting it close to xpath()'s oid. :) Appropriate regression tests will
> be added after I've ensured that 'make check' is happy I've not regressed
> anything.

I'm not sure I understand how this more convenient than just using
xpath() with exists()?

> Can I confirm that contrib/xml2 is deprecated and I should be carrying out
> my work in backend/utils/adt/xml.c?

Yes.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-05-06 15:49:26 Re: pg_migrator to /contrib in a later 9.0 beta
Previous Message Robert Haas 2010-05-06 15:38:18 Re: max_standby_delay considered harmful

Browse pgsql-rrreviewers by date

  From Date Subject
Next Message mike 2010-05-06 21:53:23 Re: Adding xpath_exists function
Previous Message Mike Fowler 2010-05-06 14:10:15 Adding xpath_exists function