Re: ScalarArrayOpExpr and multi-dimensional arrays - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ScalarArrayOpExpr and multi-dimensional arrays
Date
Msg-id 7677.1512743642@sss.pgh.pa.us
Whole thread Raw
In response to ScalarArrayOpExpr and multi-dimensional arrays  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: ScalarArrayOpExpr and multi-dimensional arrays  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
> I wonder if ScalarArrayOpExpr is not really meant for multi-dimensional
> arrays appearing on the right hand side?  Because:
> # select array[1] = any (array[array[1], array[2]]);

> ERROR:  operator does not exist: integer[] = integer

You are falling into the misimpression that a 2-D array is an array of
1-D arrays.  It is not, even if the syntax makes it look like that.

ScalarArrayOpExpr just iterates over the array elements without regard
to dimensionality; so the LHS must be of the element type.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Oliver Ford
Date:
Subject: Re: proposal: alternative psql commands quit and exit
Next
From: Tom Lane
Date:
Subject: Re: How to use set/reset role in contrib_regression test?