change array dimension - Mailing list pgsql-general

From Gerhard Heift
Subject change array dimension
Date
Msg-id 20100701233203.GC1914@gheift.kawo1.RWTH-Aachen.DE
Whole thread Raw
Responses Re: change array dimension  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Hello,

is it possible to change the dimension of an array? I am looking for something
like this:

SELECT change_array_dims('[1:2][1:2]', '{1,2,3,4}'::int[]);
 change_array_dims
-------------------
 {{1,2},{3,4}}

and the other way around:

SELECT change_array_dims('[1:4]', '{{1,2},{3,4}}'::int[]);
 change_array_dims
-------------------
 {1,2,3,4}

Does such a function exist?

Thanks,
  Gerhard

Attachment

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: different language indexes
Next
From: Stephen Denne
Date:
Subject: Help with pgAndroid Contest