Re: So what's an "empty" array anyway?
| От | Robert Haas |
|---|---|
| Тема | Re: So what's an "empty" array anyway? |
| Дата | |
| Msg-id | 603c8f070811120922k4ce6aebar2557c4268c2ea1aa@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: So what's an "empty" array anyway? (Peter Eisentraut <peter_e@gmx.net>) |
| Список | pgsql-hackers |
>> I think it's actually more correct to say that {} has an undefined
>> number of dimensions.
>
> That is your opinion, but not my argument above.
I'm aware of that. I believe that the semantics of array operations
should carry more weight than a count of curly braces, but certainly
you don't have to agree.
>> But {}, and ONLY {}, can be concatenated with an array of any number
>> of dimensions.
>
> Which doesn't necessarily make much sense ...
Well, we could change it, which would render the argument about the
current semantics of {} moot. The obvious thing to do would be create
separate empty arrays of dimensions 1, 2, 3, 4, 5, and 6, say
'{}'::int[], '{{}}'::int[], etc. This would break backward
compatibility for people using multi-dimensional arrays, but that
might not be that many people. (Dunno.)
Alternatively, we could make separate types int[], int[][], int[][][],
etc. Then '{}'::int[] would be an empty one-dimensional array,
'{}'::int[][] would be an empty two-dimensional array, etc.
...Robert
В списке pgsql-hackers по дате отправления: