Re: array support patch phase 1 patch

From: Kris Jurka <books(at)ejurka(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: array support patch phase 1 patch
Date: 2003-06-02 17:34:28
Message-ID: Pine.LNX.4.33.0306021321470.15040-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

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.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-06-02 17:36:43 Re: Proposal for Re-ordering CONF (was: Re: GUC and postgresql.conf docs)
Previous Message Joe Conway 2003-06-02 17:30:03 Re: array support patch phase 1 patch