Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
От | Brendan Jurd |
---|---|
Тема | Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL) |
Дата | |
Msg-id | CADxJZo1OP6anMVb=t2kdoqUb4SNuOAOA_ig2CzCbPYU9o6mXuw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL) ("David E. Wheeler" <david@kineticode.com>) |
Ответы |
Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re:
Should array_length() Return NULL)
|
Список | pgsql-hackers |
On 2 April 2013 11:34, David E. Wheeler <david@kineticode.com> wrote: > On Apr 1, 2013, at 4:59 PM, Robert Haas <robertmhaas@gmail.com> wrote: > >> I think the only people for whom nothing will break are the people who >> aren't using arrays in the first place. Anyone who is is likely to >> have dependencies on the way array_lower/upper work today. > > Well, what if we add new functions that return 0 for empty arrays, but leave the existing ones alone? Perhaps call themarray_size(), array_first_index(), and array_last_index(). Then nothing has to break, and we can decide independentlyif we want to deprecate the older functions in a future release. Or not. I think having an 'array_size' and an 'array_length' that behave differently would be legitimately confusing, and I can't think of any alternative function name that would concisely explain the difference in behaviour -- 'array_length_without_the_stupid_nulls' is just too long. Cheers, BJ
В списке pgsql-hackers по дате отправления: