PotgreSQL 2D array to rows

Posted by PostGreSQL newbie on Stack Overflow See other posts from Stack Overflow or by PostGreSQL newbie
Published on 2010-05-31T07:57:18Z Indexed on 2010/06/01 12:53 UTC
Read the original article Hit count: 153

Filed under:

Hello,

I am new to PostgreSQL array's.

I am trying to a write a procedure to convert array-into-rows, and wanted following output:

alphabet | number
---------+----------
       A |      10
       B |      10
       C |       6
       D |       9
       E |       3



from following:


id |                                     alphabet_series                                                                                
-------+--------------------------------------------------------------------------------------------------
     1 | {{A,10},{B,10},{C,6},{D,9},{E,3},{F,9},{I,10},{J,17},{K,16},{L,17},{M,20},{N,13},{O,19}}

I have searched for array-to-rows functions, but they all seems to accept 1-d array. but in this case, it is 2-d array.

Any pointers will be appreciated.

Many thanks.

© Stack Overflow or respective owner

Related posts about postgresql