Обсуждение: select users in a group?

Поиск
Список
Период
Сортировка

select users in a group?

От
"Johnson, Shaunn"
Дата:
Howdy:
 
I'm running Postgres 7.1.3 on RedHat Linux 2.4.7-rel 10.
 
How can I get a list of the users in a group?  For example,
I created a group called 'staff' ... I know there are five people
in this group, but how can I *see* everyone in this group?
 
Thanks!
 
-X

Re: select users in a group?

От
"Johnson, Shaunn"
Дата:
--WAIT ... I'm sorry ... by bad ...
 
--I'm looking at the table pg_group and I see
the group 'staff' listed ... along the lines, I see
what I can only assume is the UID-ish numbers
of the users that are in the group.
 
--NOW ... I want to go from THAT point to figuring
out who those people are ...
 
--Hope I caught this in time ...
 
-X
-----Original Message-----

Howdy:
 
I'm running Postgres 7.1.3 on RedHat Linux 2.4.7-rel 10.
 
How can I get a list of the users in a group?  For example,
I created a group called 'staff' ... I know there are five people
in this group, but how can I *see* everyone in this group?
 
Thanks!
 
-X

Re: select users in a group?

От
"Nigel J. Andrews"
Дата:

On Wed, 17 Apr 2002, Johnson, Shaunn wrote:

> --WAIT ... I'm sorry ... by bad ...
>
> --I'm looking at the table pg_group and I see
> the group 'staff' listed ... along the lines, I see
> what I can only assume is the UID-ish numbers
> of the users that are in the group.
>
> --NOW ... I want to go from THAT point to figuring
> out who those people are ...
>
> --Hope I caught this in time ...
>
> -X
>
> -----Original Message-----
>
>
> Howdy:
>
> I'm running Postgres 7.1.3 on RedHat Linux 2.4.7-rel 10.
>
> How can I get a list of the users in a group?  For example,
> I created a group called 'staff' ... I know there are five people
> in this group, but how can I *see* everyone in this group?
>
> Thanks!
>
> -X
>
>

Now, it's just a suggestion as I've not used arrays before but have you tried
something like:

SELECT u.usename FROM pg_user u WHERE EXISTS (SELECT 1 FROM pg_group g WHERE
g.grolist *= u.usesysid);

You should look up arrays in the documentation since I see from there that the
*= operator is probably an extension you need to install.


--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants


Re: select users in a group?

От
Bruce Momjian
Дата:
Those numbers are user id's.  If you look in pg_user you will see the
numbers of each user.

Now, we really should have a way of listing the users in a group more
easily.

Added to TODO:

    * Allow easy display of usernames in a group

---------------------------------------------------------------------------

Nigel J. Andrews wrote:
>
>
> On Wed, 17 Apr 2002, Johnson, Shaunn wrote:
>
> > --WAIT ... I'm sorry ... by bad ...
> >
> > --I'm looking at the table pg_group and I see
> > the group 'staff' listed ... along the lines, I see
> > what I can only assume is the UID-ish numbers
> > of the users that are in the group.
> >
> > --NOW ... I want to go from THAT point to figuring
> > out who those people are ...
> >
> > --Hope I caught this in time ...
> >
> > -X
> >
> > -----Original Message-----
> >
> >
> > Howdy:
> >
> > I'm running Postgres 7.1.3 on RedHat Linux 2.4.7-rel 10.
> >
> > How can I get a list of the users in a group?  For example,
> > I created a group called 'staff' ... I know there are five people
> > in this group, but how can I *see* everyone in this group?
> >
> > Thanks!
> >
> > -X
> >
> >
>
> Now, it's just a suggestion as I've not used arrays before but have you tried
> something like:
>
> SELECT u.usename FROM pg_user u WHERE EXISTS (SELECT 1 FROM pg_group g WHERE
> g.grolist *= u.usesysid);
>
> You should look up arrays in the documentation since I see from there that the
> *= operator is probably an extension you need to install.
>
>
> --
> Nigel J. Andrews
> Director
>
> ---
> Logictree Systems Limited
> Computer Consultants
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

PERL DBI and Novell Netware

От
Jeff Post
Дата:
Hello all,
   I am in the investigation phase of a potential project that would
automaticly update a novell Netware server's user accounts with information
stored on PostgreSQL Database running on a linux box through a perl script.

Currently Netware has support for
• Database Independent Interface (DBI)
• NetWare Data Object (NDO) UCX Component
• Remote ActiveX Provider and ADO Component on Windows machine

Through DBI, Netware can remotely connect to Oracle on NetWare or MS-Access,
SQL Server and Oracle, all on Windows

  Is anybody out there familure enough with dbi and Novell to be able to tell
me how I can get a perl script running on Netware to connect to a
PostgreSQL/Linux box.

Or if it is way to complicated / know one knows.  Please send an e-mail to
Enhancements@novell.com to ask that they add PostgreSQL support to Netware.

Thanks
Jeff Post