Re: Is _ a supported way to create a column of array type? - Mailing list pgsql-general

From Piotr Findeisen
Subject Re: Is _ a supported way to create a column of array type?
Date
Msg-id CAMrFzbvjWgjUuvRCz9b1ukQrwLU3P8SG_D4vZcHF-rOyWxKO1A@mail.gmail.com
Whole thread Raw
In response to Re: Is _ a supported way to create a column of array type?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Is _ a supported way to create a column of array type?
Re: Is _ a supported way to create a column of array type?
List 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 by date:

Previous
From: Rainer Pruy
Date:
Subject: Re: TCP Resets when closing connection opened via SSL
Next
From: Joe Conway
Date:
Subject: Re: Is _ a supported way to create a column of array type?