Skip site navigation (1) Skip section navigation (2)

Re: ANY/SOME/ALL with noncommutable operators

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ANY/SOME/ALL with noncommutable operators
Date: 2008-06-19 14:08:11
Message-ID: 11634.1213884491@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> I can do
> 'abc' LIKE ANY (ARRAY['a%','b%'])

> but not

> ANY (ARRAY['abc', 'def']) LIKE '%a'

> This seems to be a failing in the SQL standard. You can work around this by 
> creating your own operators, but maybe there should be a general solution, as 
> there are a lot of noncommutable operators and this example doesn't seem all 
> that unuseful in practice.

> Comments?

Making the commutator operator where you need it *is* a general solution.
I think there's a syntactic-ambiguity reason why the spec is like that...

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2008-06-19 14:26:58
Subject: Re: ANY/SOME/ALL with noncommutable operators
Previous:From: David FetterDate: 2008-06-19 13:11:32
Subject: Re: ANY/SOME/ALL with noncommutable operators

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group