Re: So what's an "empty" array anyway?
| От | Peter Eisentraut |
|---|---|
| Тема | Re: So what's an "empty" array anyway? |
| Дата | |
| Msg-id | 491AC823.1090208@gmx.net обсуждение исходный текст |
| Ответ на | So what's an "empty" array anyway? (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: So what's an "empty" array anyway?
Re: So what's an "empty" array anyway? |
| Список | pgsql-hackers |
Tom Lane wrote:
> Seems like we ought to clean this up. I'm not sure which way to jump
> though: should we decree that arrays of no elements must always have
> zero dimensions, or should we get rid of that and standardize on, say,
> 1-D array with lower bound 1 and upper bound 0?
It was pointed out to me today that a zero-dimensional matrix is a
scalar. This makes a bit of sense, if you say that
'{{56}}' is of type int[][], 2 dimensions
'{56}' is of type int[], 1 dimension
'56' is of type int, 0 dimensions
Notice that the number of brace pairs in the literal matches the number
of bracket pairs in the type declaration.
By that logic, '{}' has one dimension. I think this also works best in
practice, for example with array concatenation.
В списке pgsql-hackers по дате отправления: