converting 1 dimensional array to 2 dimensional array - Mailing list pgsql-novice

From Nicholas Wilson
Subject converting 1 dimensional array to 2 dimensional array
Date
Msg-id CABgBcYO=PCP_pP+_hk_ZYQ6gACrQ7fzJe8__xfWg3OCX5wGSoA@mail.gmail.com
Whole thread Raw
Responses Re: converting 1 dimensional array to 2 dimensional array  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-novice
Hi, need help with some syntax.

Currently we have a column of type text[]. It is a 1 dimensional array of text values. Each of them we have formatted in such a way that it can be split into two values. We are trying to convert it into a two dimensional array but are unsure how to do that.

i.e. converting:
{a^^val1, b^^val2, c^^val3}
to
{{a,val1}, {b,val2}, {c,val3}}

I can do
Select array(select '{"' || replace(unnest(col1), '^^', '","') || '"}') from table;

But that still gives me one dimensional text array. I can't cast it to text[] because there are no array of arrays. How do I get this into a 2 dimensional array?

pgsql-novice by date:

Previous
From: Gavin Flower
Date:
Subject: Re: When to choose putting logic into PL/pgSQL and when to use an app server
Next
From: "John"
Date:
Subject: Warning console code page (437) differs from Window code page (1252)