Re: So what's an "empty" array anyway?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: So what's an "empty" array anyway?
Дата
Msg-id 20081112155017.GK2459@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на Re: So what's an "empty" array anyway?  ("Robert Haas" <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Nov 12, 2008 at 09:46:09AM -0500, Robert Haas wrote:
> The || operator is valid only if the dimensions
> of the two arrays are equal (in which case it appends them) or if the
> dimension of one of the arrays is one less than the other (in which
> case, if legal, it treats the array of lesser dimension as a new
> element to be added to the other array).

In most other languages these would be distinct operations; one to
append or concatenate two arrays of equal dimensionality and another to
add a new element on the end.  It's very rare that you don't know which
one you want to do when you're writing code and hence breaking the two
apart both simplifies the implementation of the array handling code and
reduces bugs in the calling code.
 Sam


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

Предыдущее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Enabling archive_mode without restart
Следующее
От: "Hitoshi Harada"
Дата:
Сообщение: Re: Window functions review