pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedsearch for groups with a user
3+ messages / 2 participants
[nested] [flat]
* search for groups with a user
@ 2001-05-16 08:49 Martín Marqués <martin@bugs.unl.edu.ar>
2001-05-18 15:35 ` Re: search for groups with a user george young <gry@ll.mit.edu>
0 siblings, 1 reply; 3+ messages in thread
From: Martín Marqués @ 2001-05-16 08:49 UTC (permalink / raw)
To: pgsql-sql
I have to search for which groups a certain user is in. I found out that the
field grolist is of type INT[] (array of integers with reference to the
uids). To search through the array I need a module which is in contrib/array,
which I found, but how do I use it? What do I have to do to be able to do
searches on arrays in the WHERE clause?
Saludos... :-)
--
Cualquier administra un NT.
Ese es el problema, que cualquier administre.
-----------------------------------------------------------------
Martin Marques | mmarques@unl.edu.ar
Programador, Administrador | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: search for groups with a user
2001-05-16 08:49 search for groups with a user Martín Marqués <martin@bugs.unl.edu.ar>
@ 2001-05-18 15:35 ` george young <gry@ll.mit.edu>
2001-05-18 13:26 ` Re: search for groups with a user Martín Marqués <martin@bugs.unl.edu.ar>
0 siblings, 1 reply; 3+ messages in thread
From: george young @ 2001-05-18 15:35 UTC (permalink / raw)
To: pgsql-sql; +Cc: Mart?n Marqu?s <martin@bugs.unl.edu.ar>
On Wed, 16 May 2001 11:49:40 +0300
Martín Marqués <martin@bugs.unl.edu.ar> wrote:
> I have to search for which groups a certain user is in. I found out that the
> field grolist is of type INT[] (array of integers with reference to the
> uids). To search through the array I need a module which is in contrib/array,
> which I found, but how do I use it? What do I have to do to be able to do
> searches on arrays in the WHERE clause?
In postgresq-7.0.3, I did:
cd contrib/array
make
make install
[I'm not certain the following is necessary, but if you get errors it might fix things]
psql -d yourdb -f array_iterator.sql
[or whereever install put it]
Then, just try something like:
select groname from pg_group g, pg_user u
where g.grolist *= u.usesysid and
u.usename = 'young' ;
groname
------------
supervisor
originator
operator
(3 rows)
showing that I'm in those three groups.
I hope this helps,
-- George
--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now? [OK]
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: search for groups with a user
2001-05-16 08:49 search for groups with a user Martín Marqués <martin@bugs.unl.edu.ar>
2001-05-18 15:35 ` Re: search for groups with a user george young <gry@ll.mit.edu>
@ 2001-05-18 13:26 ` Martín Marqués <martin@bugs.unl.edu.ar>
0 siblings, 0 replies; 3+ messages in thread
From: Martín Marqués @ 2001-05-18 13:26 UTC (permalink / raw)
To: george young <gry@ll.mit.edu>; pgsql-sql
On Vie 18 May 2001 18:35, george young wrote:
> On Wed, 16 May 2001 11:49:40 +0300
>
> Martín Marqués <martin@bugs.unl.edu.ar> wrote:
> > I have to search for which groups a certain user is in. I found out that
> > the field grolist is of type INT[] (array of integers with reference to
> > the uids). To search through the array I need a module which is in
> > contrib/array, which I found, but how do I use it? What do I have to do
> > to be able to do searches on arrays in the WHERE clause?
>
> In postgresq-7.0.3, I did:
>
> cd contrib/array
> make
> make install
This didn't work, but I got it to work, compiling by hand (gcc and ld).
Until I found it in the docs.... :-)
Saludos... :-)
--
Cualquier administra un NT.
Ese es el problema, que cualquier administre.
-----------------------------------------------------------------
Martin Marques | mmarques@unl.edu.ar
Programador, Administrador | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-05-18 15:35 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-16 08:49 search for groups with a user Martín Marqués <martin@bugs.unl.edu.ar>
2001-05-18 15:35 ` george young <gry@ll.mit.edu>
2001-05-18 13:26 ` Martín Marqués <martin@bugs.unl.edu.ar>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox