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

BUG #4509: array_cat's null behaviour is inconsistent

From: "Kevin Field" <kev(at)brantaero(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4509: array_cat's null behaviour is inconsistent
Date: 2008-11-03 18:07:48
Message-ID: 200811031807.mA3I7mbg038076@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4509
Logged by:          Kevin Field
Email address:      kev(at)brantaero(dot)com
PostgreSQL version: 8.3.4
Operating system:   Windows Server 2003 SP2
Description:        array_cat's null behaviour is inconsistent
Details: 

Section 9.2 in the docs say, 'The ordinary comparison operators yield null
(signifying "unknown") when either input is null.'  This applies to other
operators too.  For example, the result of tacking an unknown value onto a
known one is unknown, because you don't know what exactly you just tacked
on.  So

   select null::text || 'hello';

...returns NULL, which makes sense.  But then this

   select array_cat(null::integer[], '{3}'::integer[]);

...doesn't return NULL, which it should, for consistency.

Kev

Responses

pgsql-bugs by date

Next:From: Zahid KhanDate: 2008-11-04 09:10:25
Subject: Behavior change of FK info query
Previous:From: Alvaro HerreraDate: 2008-11-03 15:40:25
Subject: Re: Docbook DSSSL Stylesheets link is broken

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