Search Postgresql Archives

array_cat null reasoning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm a bit confused as to the logic of nulls.  I understand that null
is to represent an unknown value.  So it makes sense that 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';


...returning NULL makes sense.  But then why doesn't


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


...also return null?  Somehow it's known what the result is when
combining an unknown array with a known one, but not when combining an
unknown text with a known one?  Doesn't this seem inconsistent?  If it
does seem inconsistent, should I be careful how to code because this
might change in the future?

Thanks,
Kev

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux