Skip site navigation (1) Skip section navigation (2)

Adding xpath_exists function

From: Mike Fowler <mike(at)mlfowler(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Adding xpath_exists function
Date: 2010-05-06 14:10:15
Message-ID: 4BE2CDC7.6050508@mlfowler.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-rrreviewers
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.

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

I shall be coding it up over the next day or two, work & family permitting!

Thanks,

-- 
Mike Fowler
Registered Linux user: 379787


Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-05-06 14:19:05
Subject: Re: pg_migrator to /contrib in a later 9.0 beta
Previous:From: Dimitri FontaineDate: 2010-05-06 14:09:57
Subject: Re: max_standby_delay considered harmful

pgsql-rrreviewers by date

Next:From: Robert HaasDate: 2010-05-06 15:43:09
Subject: Re: Adding xpath_exists function
Previous:From: Josh BerkusDate: 2010-02-01 00:16:08
Subject: Re: Orphaning my patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group