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

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

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Mike Fowler <mike(at)mlfowler(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Round Robin Reviewers <pgsql-rrreviewers(at)postgresql(dot)org>
Subject: Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function
Date: 2010-07-27 23:55:52
Message-ID: 1280274952.11610.7.camel@jdavis-ux.asterdata.local (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-rrreviewers
On Tue, 2010-07-27 at 19:41 -0400, Robert Haas wrote:
> On Tue, Jul 27, 2010 at 7:33 PM, David Fetter <david(at)fetter(dot)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() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
> >
> >        Dollar quote:
> >
> >        SELECT xpath_exists($$//town[text() = 'Cwmbran']$$,'<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
> 
> Personally, I don't really see that as an improvement.  Dollar-quotes
> are really nice for longer strings, or where you would otherwise have
> quadrupled quotes (or more), but I don't see a big advantage to it
> here.  Still, it's a question of opinion more than anything else.

I like the idea of using dollar quotes, but I think they should be used
for both arguments (or neither). Using $$ for one and then shifting to
"'" for the second argument with no whitespace at all seems like the
least readable option.

Regards,
	Jeff Davis


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-07-28 00:27:48
Subject: Re: Incorrect FTS result with GIN index
Previous:From: Tom LaneDate: 2010-07-27 23:47:20
Subject: Re: Parsing of aggregate ORDER BY clauses

pgsql-rrreviewers by date

Next:From: Kevin GrittnerDate: 2010-07-28 13:58:43
Subject: Another patch now needs reviewer
Previous:From: Robert HaasDate: 2010-07-27 23:41:29
Subject: Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function

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