Re: join of array

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: join of array
Дата
Msg-id 3F3D131C.90909@joeconway.com
обсуждение исходный текст
Ответ на Re: join of array  (elein <elein@varlena.com>)
Ответы Re: join of array  (elein <elein@varlena.com>)
Re: join of array  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
elein wrote:
>>  ARRAY[[1,2],[3,4]] || ARRAY[[1,2],[3,4]] ==
>>                               '{{{1,2},{3,4}},{{1,2},{3,4}}}'
>>
>>I think the first two still make sense. I guess the third case ought to be:
>>  ARRAY[[1,2],[3,4]] || ARRAY[[1,2],[3,4]] ==
>>                               '{{1,2},{3,4},{1,2},{3,4}}'
>>?
>
> I do not think this is right. I think the current behaviour
> is right.  You are effectively dereferencing or flattening
> the second array which changes the definition of the second
> object.

It makes sense in analogy to
   ARRAY[1,2] || ARRAY[3,4] == '{1,2,3,4}'

In the case of, e.g. ARRAY[[1,2],[3,4]] || ARRAY[[5,6],[7,8]],
'{1,2}', '{3,4}', '{5,6}', and '{7,8}' are "elements" of the higher
level array, just like 1, 2, 3, & 4 are elements of '{1,2,3,4}'

Joe


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

Предыдущее
От: Jenny Zhang
Дата:
Сообщение: getting execution plans with multiple database connections
Следующее
От: expect
Дата:
Сообщение: summary and request