pgsql 8.4 "not" + "is contained by" operators return wrong result

From: László Lajos Jánszky <laszlo(dot)janszky(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: pgsql 8.4 "not" + "is contained by" operators return wrong result
Date: 2013-07-25 16:41:05
Message-ID: CA+=RcCoVbUhxMgRb_HauTs7rTLOKc2ud-L1UieL6GsCt4=e8HA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

*Description:*

By pgsql 8.4 I have the following bug:

If the haystack array is null (for example by empty result of array_agg) by
is contained by, and you use it with negation, the the result is false
instead of true.

*Reproduce:*

The following query returns nothing, but it should return 1.

*SELECT 1 FROM NOT(ARRAY[1] <@ NULL**); *

*Workaround:*

*SELECT 1 FROM (haystack IS NULL OR NOT(ARRAY[1] <@ **haystack**)); *

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavan Deolasee 2013-07-25 16:52:44 Re: BUG #8334: Merge Join drops records
Previous Message Tom Lane 2013-07-25 16:18:18 Re: BUG #8271: Configure warning: sys/ucred.h: present but cannot be compiled