pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: pgsql-sql@postgresql.org
Subject: Comparing a string against an XPath result set
Date: Thu, 16 Jul 2009 21:19:56 +0000
Message-ID: <m3ljmocolf.fsf@passepartout.tim-landscheidt.de> (raw)

Hi,

I'm trying to check whether a given string is part of an
XPath result set. I have encountered some performance prob-
lems in the process, but before I track those down further,
I'd like to see if I've chosen the right path to begin with:

| SELECT * FROM $TABLE
|   WHERE $COLUMN = ANY((xpath($EXPR, xmlparse(DOCUMENT $DOC)))::TEXT[]);

In this case, xpath() returns an array of XML fragments made
of a "pure" text child each. I cannot compare XML fragments
with anything, so the conversion to TEXT[] seems to be the
only way I could check whether $COLUMN is a part of those.

  Is there any other way I could tackle this?

Tim




Message-ID: <m3ljmocolf.fsf@passepartout.tim-landscheidt.de>
Permalink:  ../m3ljmocolf.fsf@passepartout.tim-landscheidt.de/
Also on:    postgresql.org/message-id/m3ljmocolf.fsf@passepartout.tim-landscheidt.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tim@tim-landscheidt.de
  Subject: Re: Comparing a string against an XPath result set
  In-Reply-To: <m3ljmocolf.fsf@passepartout.tim-landscheidt.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox