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]

 



Hi David,

On 12/20/2012 08:48 PM, David Johnston wrote:
-----Original Message-----
From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-
owner@xxxxxxxxxxxxxx] On Behalf Of Denis Papathanasiou
Sent: Thursday, December 20, 2012 7:56 PM
To: pgsql-general@xxxxxxxxxxxxxx
Subject:  Using POSIX Regular Expressions on xml type fields
gives
inconsistent results
[snip]
[At this point I'd confirm or question why ANY hasn't been made to go both
ways but also realize that I will have to approach this in a different way
to achieve my goal.]

I did realize that ANY() must be a right-hand operator, but what I didn't understand (and admittedly still don't understand) is why regex operations that are normally right-side work from the left.

If you look at the four examples which follow the posix match table in the docs (http://www.postgresql.org/docs/9.1/static/functions-matching.html#FUNCTIONS-POSIX-TABLE), some of them work from the left side, e.g.:

'abc' ~ '(b|d)'  true

In my original example, I found I could write this from left to right like this, and it would still work:

'(b|d)' ~ 'abc'  true

But when I reverse this expression:

'abc' ~ '^a'     true

like this, it doesn't work:

'^a' ~ 'abc'     false




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