I am new at PostgreSQL, I use array type in PostgreSQL
WITH intarr AS (
SELECT
ARRAY [ s.days,s.hours ] ::int[] AS arr
FROM summary s
WHERE s.hours != 2
)
SELECT ARRAY(SELECT * from intarr );
I get this error:
[Err] ERROR: could not find array type for data type integer[]
I find a way change
ARRAY [ s.days,s.hours ] ::int[] AS arr
row to this
ARRAY [ s.days,s.hours ] ::varchar AS arr
I get result like : {"{1,3}","{2,3}"} . But I need result int[][] type .How I convert one-dimensional array to two-dimensional array
SELECT replace( (SELECT ARRAY(SELECT arr from intarr)::VARCHAR), '"', '')::int[][]