Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results - Mailing list pgsql-general

From David Johnston
Subject Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results
Date
Msg-id 01b901cddf18$846d09c0$8d471d40$@yahoo.com
Whole thread Raw
In response to Using POSIX Regular Expressions on xml type fields gives inconsistent results  (Denis Papathanasiou <denis.papathanasiou@banrai.com>)
List pgsql-general
>
> I have a table with an xml type column, and while I can make regex queries
> like this successfully:
>
> => select id from form_d where 'kumar' ~* any(
> CAST(xpath('//PersonsList/PersonName/LastName/text()', data) as TEXT[])
> );

It took me way too long to figure this out:

SELECT 'text to search against'  ~* 'regular expression'

The text to be searched must be on the left-hand side of the operator and
thus the regular expression operators cannot be used with "ANY/ALL" because
they require that the text to be search exist on the right-hand side of the
operator.

I'll let others respond as to the difficulty of implementing a LHS-Array
version of ANY/ALL

David J.




pgsql-general by date:

Previous
From: Denis Papathanasiou
Date:
Subject: Using POSIX Regular Expressions on xml type fields gives inconsistent results
Next
From: "David Johnston"
Date:
Subject: Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results