On Mon, 2 Jun 2003, Joe Conway wrote:
> Kris Jurka wrote:
> > I was trying formulate a way to make a function which will explode an
> > array into a resultset composed of the index and value. So '{3,4,7}'
> > would become
> >
> > index value
> > 1 3
> > 2 4
> > 3 7
> >
>
> I submitted a function that would do this, array_values(), but it was
> rejected. See:
> http://archives.postgresql.org/pgsql-hackers/2002-12/msg00453.php
>
> Perhaps we should revisit that decision before feature freeze for 7.4?
For the group listing example given in your original post what I want to
is produce a query which could return:
group_name member_name
g1 user1
g1 user2
g2 user1
g2 user2
g2 user3
This can be done with the current array functionality:
SELECT g.groname, s.usename
FROM pg_group g, pg_shadow s
WHERE s.usesysid = ANY (g.grolist);
The problem arises when trying to join arrays as if they were tables.