Re: Boolean operators without commutators vs. ALL/ANY

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Boolean operators without commutators vs. ALL/ANY
Date: 2011-06-14 10:10:18
Message-ID: E72034A3-D7CF-47EF-AB91-11A02B8090F5@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jun13, 2011, at 05:44 , Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Sun, Jun 12, 2011 at 7:46 AM, Florian Pflug <fgp(at)phlo(dot)org> wrote:
>>> (B) There should be a way to use ANY()/ALL() with the
>>> array elements becoming the left arguments of the operator.
>
>> It seems to me that if we provided some way of handling this, your
>> first proposal would be moot; and I have to say I like the idea of
>> allowing this a lot more than tinkering with the operator names.
>
> There are syntactic reasons not to do that. It'd be a lot easier just
> to provide a commutator operator for ~.

My suggestion would be the add a commutator for "~" as a short-term
solution (preferably in 9.1).

Since "~" doesn't inspire any obvious names for a possible commutator,
I suggest adding "=~" and "~=".

Is there any support for that proposal?

In the long term, I'd like to add support for "(ANY() <op> <expr>)"
(Note the enclosing parens). I've checked that this works grammar-wise,
but haven't no idea how much tweaking the executor needs to support
that...

best regards,
Florian Pflug

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-06-14 11:03:05 Re: SSI work for 9.1
Previous Message Florian Pflug 2011-06-14 10:05:45 Re: Boolean operators without commutators vs. ALL/ANY