Re: array_length() - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: array_length()
Date
Msg-id 491198FB.7090504@gmx.net
Whole thread Raw
In response to array_length()  (Decibel! <decibel@decibel.org>)
Responses Re: array_length()
Re: array_length()
Re: array_length()
List pgsql-hackers
Decibel! wrote:
> ISTM it'd be useful to have an array_length function (since I just wrote 
> one for work ;), so here's a patch. Note that I don't have the docs 
> toolchain setup, so I wasn't able to test the doc patches.

There is a tiny problem with this implementation: It returns null for an 
empty array, not zero.  This is because array_lower and/or array_upper 
return null for an empty array, which makes sense for those cases.  We 
could fix this by putting a coalesce around the expression, but since 
the array functions return null for all kinds of error cases, this might 
mask other problems.  Or we move to a C implementation.



pgsql-hackers by date:

Previous
From: "Fujii Masao"
Date:
Subject: Re: Synchronous replication patch v1
Next
From: Gianni Ciolli
Date:
Subject: Re: usermap regexp support