Re: Is _ a supported way to create a column of array type?

Поиск
Список
Период
Сортировка
От Piotr Findeisen
Тема Re: Is _ a supported way to create a column of array type?
Дата
Msg-id CAMrFzbvjWgjUuvRCz9b1ukQrwLU3P8SG_D4vZcHF-rOyWxKO1A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is _ a supported way to create a column of array type?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Is _ a supported way to create a column of array type?
Re: Is _ a supported way to create a column of array type?
Список pgsql-general
Hi Tom,

I think I understand now.

Postgres type system does not distinguish between array types with different
number of dimensions. int[], int[][] and int[][][][][][] are all equivalent to the type system.

Number of dimensions is part of the value though and execution takes care of it.
If I subscript an array with wrong "number of brackets" (as in
`select (array[1,2,3])[1][1][1]`) I get NULL. 

Presto type system however distinguishes array(integer), array(array(integer))...
(using Presto therms). And execution is (expectedly) not as flexible.

We can inspect number of brackets that were written in the table creation
command but that's inferring (and enforcing) strong typing for something that is
not strongly typed. Thus, we can fail at execution.

Do you have any plans to support arrays with different number of dimensions
in the type system?

Best,
Piotr

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

Предыдущее
От: Rainer Pruy
Дата:
Сообщение: Re: TCP Resets when closing connection opened via SSL
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Is _ a supported way to create a column of array type?