pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: knz@thaumogen.net
Subject: BUG #15298: Array-array comparisons when arrays contain NULLs
Date: Thu, 26 Jul 2018 13:43:06 +0000
Message-ID: <153261258644.1404.3005762345361971551@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15298
Logged by:          kena
Email address:      knz@thaumogen.net
PostgreSQL version: 10.4
Operating system:   FreeBSD + Linux
Description:        

The SQL standard mandates ternary logic for values that involve NULL, where
NULL means "unknown".

This seems to be implemented only partially in pg:

"select 3 = any (array[1, null])" -> returns NULL, correct
"select null = any (array[1, null])" -> returns NULL, correct
"select 3 in (select unnest(array[1,null]))" -> returns NULL, correct
"select null in (select unnest(array[1,null]))" -> returns NULL, correct

However:

"select array[1,2] = array[1,null]" -> returns false !?
"select array[1,null] = array[1,null]" -> returns true !?

Is this intended behavior? If so, where is it documented?

If not intended, any suggestion as to how to work around it?

Thanks in advance,

-- 
Raphael 'kena' Poss



Message-ID: <153261258644.1404.3005762345361971551@wrigleys.postgresql.org>
Permalink:  ../153261258644.1404.3005762345361971551@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/153261258644.1404.3005762345361971551@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, knz@thaumogen.net
  Subject: Re: BUG #15298: Array-array comparisons when arrays contain NULLs
  In-Reply-To: <153261258644.1404.3005762345361971551@wrigleys.postgresql.org>
  References: <153261258644.1404.3005762345361971551@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox