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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: So what's an "empty" array anyway?
Дата
Msg-id 28521.1224613401@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: So what's an "empty" array anyway?  ("Merlin Moncure" <mmoncure@gmail.com>)
Ответы Re: So what's an "empty" array anyway?  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-hackers
"Merlin Moncure" <mmoncure@gmail.com> writes:
> ISTM this is the way it should work from SQL level:

> '{}'::int[] empty 1d
> '{{},{}}'::int[] :: empty 2d

The first one looks okay, but ISTM the second one is not describing
an "empty" array: the upper dimension is of length 2.  In particular
I think that under your proposal array_dims() would probably yield
these results:
[1:0][1:2][1:0]

and all of these would be different:

'{{}}'::int[]            [1:1][1:0]
'{{},{}}'::int[]        [1:2][1:0]
'{{},{},{}}'::int[]        [1:3][1:0]

Maybe this is okay but it feels a bit weird.

> If you dump zero dimension arrays, then the problem about what to do
> with array_dims goes away.

I'm not against dropping zero-dimension arrays ...
        regards, tom lane


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

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: So what's an "empty" array anyway?
Следующее
От: Decibel!
Дата:
Сообщение: Re: Regression in IN( field, field, field ) performance