gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Username


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Username
Date: Fri, 24 Feb 2012 11:00:30 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Feb 23, 2012 at 11:57:12PM +0000, Jim Busser wrote:

> To look over the list of actually-existing DB accounts, one can login to psql 
> using gm-dbo or any other valid account and then issuing:
> 
>       select rolname, oid, rolcanlogin, rolvaliduntil from pg_roles where 
> substring(rolname for 7) <> 'gnumed_' order by rolsuper desc, rolcreaterole 
> desc, rolcanlogin desc, rolname;
> 
> which (omitting the names of database versions) gives something like
> 
>           rolname     |  oid  | rolcanlogin |     rolvaliduntil      
>       ----------------+-------+-------------+------------------------
>        postgres       |    10 | t           | 
>        gm-dbo         | 16403 | t           | 
>        any-doc        | 16410 | t           | 
>        any-staff      | 69361 | t           | 
>        jabu           | 81511 | t           | 
>        test-doc       | 16411 | t           | 2004-12-31 00:00:00-08
>        test-nurse     | 16412 | t           | 2004-12-31 00:00:00-08
>        test-secretary | 16413 | t           | 2004-12-31 00:00:00-08
>        gm-doctors     | 16397 | f           | 
>        gm-logins      | 16396 | f           | 
>        gm-public      | 16402 | f           | 
>        gm-staff       | 69199 | f           | 
>       (14 rows)

Indeed. Also, the following SQL function makes easier
getting the accounts related to a certain GNUmed database:

        select gm.get_users();                                          -- for 
the logged-on database
        select gm.get_users(<gnumed_vNUMBER>);          -- for the vNUMBER 
database

This is used by the GNUmed backup scripts to learn
of the relevant roles.

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]