Search Postgresql Archives

Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> 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.




-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux