ARRAY_LENGTH() function behavior with empty array

From: otar shavadze <oshavadze(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: ARRAY_LENGTH() function behavior with empty array
Date: 2016-12-02 13:51:06
Message-ID: CAG-jOyAJAyebZj_K-qqTR+W4VjvH2mCePppWYi48qoggiaR-MQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

SELECT ARRAY_LENGTH('{}'::INT[], 1)

This returns NULL, not so "dangerous" either way, not would be more
logically, if array length function will return 0 from empty array,
instead of NULL ?

This is just IMHO.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pinker 2016-12-02 14:04:44 Strange activity of prepared queries
Previous Message Stephen Frost 2016-12-02 13:15:09 Re: Postgresql 9.6 and Big Data