Array extraction - Mailing list pgsql-general

From veejar
Subject Array extraction
Date
Msg-id a4c4d7e50703310405j52e24d24hf1294ca642f18bc3@mail.gmail.com
Whole thread Raw
Responses Re: Array extraction  (andyk <andyk@commandprompt.com>)
List pgsql-general
Hi!

I have such table:

user_group
---------------------------------
ug_id -> serial primary key
ug_users -> int4[]

For example table has such rows:
 ug_id | ug_users

-------+--------------
1 | { 2,5,6 }
2 | { 3,4,9 }
I want to write SQL-query or write user defined function to get such result (extract array values):
 ug_id | ug_users
-------+--------------
1 | 2
1 | 5
1 | 6
2 | 3
2 | 4
2 | 9

Help please to solve this problem.
--
Vadim

pgsql-general by date:

Previous
From: "Mikko Partio"
Date:
Subject: Re: Anyone know where I can get an 8.2.3 binary for ubuntu?
Next
From: Csaba Kalman
Date:
Subject: Re: PANIC: unexpected hash relation size