Re: Missing array support

From: Joe Conway <mail(at)joeconway(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing array support
Date: 2003-06-28 21:11:46
Message-ID: 3EFE0492.4000207@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut wrote:
> Btw., it would be really nice if some limited form of this could get done,
> so I could finish the information schema views pertaining to group
> privileges. I'd just need a way to find out what users are in what
> groups. If unnest() would work for locally constant arguments, I think it
> could be done like
>
> SELECT g.groname
> FROM pg_user u, pg_group g
> WHERE u.usesysid IN (SELECT * FROM UNNEST((SELECT grolist FROM pg_group WHERE grosysid = g.grosysid)))
> AND u.usename = current_user;
>
> Or is there some other way to do this now?
>

It isn't in CVS yet, but hopefully before Monday evening you'll be able
to do this:

regression=# create user u1;
CREATE USER
regression=# create user u2;
CREATE USER
regression=# create user u3;
CREATE USER
regression=# create group g1 with user u1,u2;
CREATE GROUP
regression=# create group g2 with user u1,u2,u3;
CREATE GROUP
regression=# \c - u1
You are now connected as new user u1.
regression=> SELECT g.groname FROM pg_group g, pg_user u WHERE u.usename
= current_user AND u.usesysid = ANY (g.grolist);
groname
---------
g1
g2
(2 rows)

Joe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-06-28 21:44:35 Re: persistant psql feature suggestion
Previous Message Peter Eisentraut 2003-06-28 20:54:21 Re: Documentation is building again

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-06-29 00:55:20 Re: Missing array support
Previous Message Peter Eisentraut 2003-06-28 20:48:49 Re: Missing array support