Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-08-08 Thread Tom Lane
Mike Fowler m...@mlfowler.com writes: On 06/08/10 20:55, Peter Eisentraut wrote: On fre, 2010-08-06 at 09:04 +0100, Mike Fowler wrote: If the patch is to be committed, does it make sense for me to refine it such that it uses the new xpath internal function you extracted in the xmlexists

Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-08-07 Thread Mike Fowler
On 06/08/10 20:55, Peter Eisentraut wrote: On fre, 2010-08-06 at 09:04 +0100, Mike Fowler wrote: If the patch is to be committed, does it make sense for me to refine it such that it uses the new xpath internal function you extracted in the xmlexists patch? Yes, you can probably shrink this

Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-08-06 Thread Mike Fowler
On 06/08/10 05:38, Peter Eisentraut wrote: On tis, 2010-07-27 at 16:33 -0700, David Fetter wrote: * Do we already have it? Not really. There are kludges to accomplish these things, but they're available mostly in the sense that a general-purpose language allows you to write

Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-08-06 Thread Peter Eisentraut
On fre, 2010-08-06 at 09:04 +0100, Mike Fowler wrote: If the patch is to be committed, does it make sense for me to refine it such that it uses the new xpath internal function you extracted in the xmlexists patch? Yes, you can probably shrink this patch down to about 20 lines. -- Sent via

Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-08-05 Thread Alvaro Herrera
Excerpts from Mike Fowler's message of mar jun 29 06:37:28 -0400 2010: After seeing some other posts in the last couple of days, I realised I hadn't documented the function in the SGML. I have now done so, and added a couple of tests with XML literals. Please find the patch attached. Now

Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-08-05 Thread Peter Eisentraut
On tis, 2010-07-27 at 16:33 -0700, David Fetter wrote: * Do we already have it? Not really. There are kludges to accomplish these things, but they're available mostly in the sense that a general-purpose language allows you to write code to do anything a Turing machine can

Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-07-27 Thread David Fetter
== Submission review == * Is the patch in context diff format? Yes. * Does it apply cleanly to the current CVS HEAD? Yes. patch -p1 ../xpath_exists-3.patch patching file doc/src/sgml/func.sgml Hunk #1 succeeded at 8642 (offset 16 lines). patching file

Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-07-27 Thread Robert Haas
On Tue, Jul 27, 2010 at 7:33 PM, David Fetter da...@fetter.org wrote:        Minor quibble with the regression tests: should we be using        dollar quotes in things like this?  Doubled-up quote marks:        SELECT xpath_exists('//town[text() =

Re: [RRR] Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-07-27 Thread Jeff Davis
On Tue, 2010-07-27 at 19:41 -0400, Robert Haas wrote: On Tue, Jul 27, 2010 at 7:33 PM, David Fetter da...@fetter.org wrote: Minor quibble with the regression tests: should we be using dollar quotes in things like this? Doubled-up quote marks: SELECT

Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

2010-06-29 Thread Mike Fowler
Mike Fowler wrote: Bruce Momjian wrote: I have added this to the next commit-fest: https://commitfest.postgresql.org/action/commitfest_view?id=6 Thanks Bruce. Attached is a revised patch which changes the code slightly such that it uses an older version of the libxml library. I've

[PATCH] Re: [HACKERS] Adding xpath_exists function

2010-06-27 Thread Mike Fowler
Bruce Momjian wrote: I have added this to the next commit-fest: https://commitfest.postgresql.org/action/commitfest_view?id=6 Thanks Bruce. Attached is a revised patch which changes the code slightly such that it uses an older version of the libxml library. I've added comments to

Re: [HACKERS] Adding xpath_exists function

2010-05-31 Thread Bruce Momjian
Mike Fowler wrote: Robert Haas wrote: Please email your patch to the list (replying to this email is fine) and add it here: https://commitfest.postgresql.org/action/commitfest_view/open Here's my patch, developed against HEAD, that adds the function 'xpath_exists'. The function is a

Re: [HACKERS] Adding xpath_exists function

2010-05-11 Thread Mike Fowler
Robert Haas wrote: Please email your patch to the list (replying to this email is fine) and add it here: https://commitfest.postgresql.org/action/commitfest_view/open Here's my patch, developed against HEAD, that adds the function 'xpath_exists'. The function is a lot simpler than originally

Re: [HACKERS] Adding xpath_exists function

2010-05-07 Thread Mike Fowler
Robert Haas wrote: Oh, I see. Well, that might be reasonable syntactic sugar, although I think you should make it wrap the path in exists() unconditionally, rather than testing for an existing wrap. I'll leave it out for now, it saves me some effort after all. Please email your patch to

Re: [HACKERS] Adding xpath_exists function

2010-05-06 Thread Robert Haas
On Thu, May 6, 2010 at 10:10 AM, Mike Fowler m...@mlfowler.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

Re: [HACKERS] Adding xpath_exists function

2010-05-06 Thread mike
Quoting Robert Haas robertmh...@gmail.com: I'm not sure I understand how this more convenient than just using xpath() with exists()? It will save a lot of complexity in WHERE clauses. For example using exists() in xpath() you might construct something like: WHERE

Re: [HACKERS] Adding xpath_exists function

2010-05-06 Thread Robert Haas
On Thu, May 6, 2010 at 5:53 PM, m...@mlfowler.com wrote: Quoting Robert Haas robertmh...@gmail.com: I'm not sure I understand how this more convenient than just using xpath() with exists()? It will save a lot of complexity in WHERE clauses. For example using exists() in xpath() you might