Re: array_length()
От | Decibel! |
---|---|
Тема | Re: array_length() |
Дата | |
Msg-id | 4DCC69BA-ECEE-48B8-9F09-20DCA09A7C56@decibel.org обсуждение исходный текст |
Ответ на | Re: array_length() (Peter Eisentraut <peter_e@gmx.net>) |
Список | pgsql-hackers |
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 decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828
В списке pgsql-hackers по дате отправления: