On Nov 5, 2008, at 7:00 AM, Peter Eisentraut wrote:
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.
What other error conditions? If we hit a real error, we should throw an error.
Granted, there is some debate possible about what referencing an un- defined dimension means, but I can't see how the results of that should vary between array_length and array_lower/upper.
Is there some other corner case? -- Decibel!, aka Jim C. Nasby, Database Architect [EMAIL PROTECTED] Give your computer some brain candy! www.distributed.net Team #1828 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers