Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Дата
Msg-id CAHyXU0xY_Y9iSxksaL86-Ktoo83ZV6A5VqG4QBaa1NboZz2SbQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Brendan Jurd <direvus@gmail.com>)
Ответы Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On Wed, Jun 12, 2013 at 10:00 PM, Brendan Jurd <direvus@gmail.com> wrote:
> On 13 June 2013 04:26, Merlin Moncure <mmoncure@gmail.com> wrote:
>> On Wed, Jun 12, 2013 at 1:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Josh Berkus <josh@agliodbs.com> writes:
>>>> On 06/12/2013 11:01 AM, Tom Lane wrote:
>>>>> I'm going to be disappointed if all we can get out of this is
>>>>> a cardinality() function, and nothing is done about the empty-array
>>>>> semantics.
>
> I would be disappointed too, but on the other hand, CARDINALITY is
> required by the spec and anything would be better than nothing.

certainly.

>> But, couldn't that be solved by deprecating that function and
>> providing a more sensible alternatively named version?
>
> And what would you name that function?  array_dims2?  I can't think of
> a name that makes the difference in behaviour apparent.  Can you
> imagine the documentation for that?

I don't know the answer to that, but I think it's hard to argue that
deprecating and documenting a few functions is a heavier burden on
your users than having to sift through older arcane code before
upgrading to the latest version of the database.  We're not the only
ones stuck with lousy old functions (C finally ditched gets() in the
2011 standard).  I also happen to think the current array_api function
names are not particularly great (especially array_upper/array_lower)
so I won't shed too many tears.

merlin



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: [PATCH] Remove useless USE_PGXS support in contrib