Re: [GENERAL] Regular expressions and arrays and ANY() question

2007-01-23 Thread David Fetter
On Tue, Jan 23, 2007 at 09:30:49AM -0500, Tom Lane wrote: > Martijn van Oosterhout writes: > > If you created such a function, and made an operator with it that > > was a communtator of LIKE (call it "is liked by"), would the > > planner be smart enough to split the ANY and commutate it to the > >

Re: [GENERAL] Regular expressions and arrays and ANY() question

2007-01-23 Thread Tom Lane
Martijn van Oosterhout writes: > If you created such a function, and made an operator with it that was a > communtator of LIKE (call it "is liked by"), would the planner be smart > enough to split the ANY and commutate it to the normal order? No, at least not as of 8.2, because ANY translates as

Re: [GENERAL] Regular expressions and arrays and ANY() question

2007-01-22 Thread Martijn van Oosterhout
On Tue, Jan 23, 2007 at 12:59:38AM -0500, Tom Lane wrote: > > I think the problem is because the pattern expects to be on the right > > side with the target on the left, but I want to do it reversed. > > Yeah, the ANY syntax only allows the array on the right. You'd have to > make a LIKE-ish ope

Re: [GENERAL] Regular expressions and arrays and ANY() question

2007-01-22 Thread Tom Lane
[EMAIL PROTECTED] writes: > I am trying to figure out how to use a regex and an ANY(), without any > luck, to determine if at least one element of an array (on the right) > matches the given constant pattern (on the left). > I think the problem is because the pattern expects to be on the right >