[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Username
From: |
Busser, Jim |
Subject: |
Re: [Gnumed-devel] Username |
Date: |
Thu, 23 Feb 2012 23:57:12 +0000 |
On 2012-02-23, at 2:59 PM, Karsten Hilbert wrote:
> On Thu, Feb 23, 2012 at 02:01:01AM +0000, Vaibhav Banait wrote:
>
>> I am run into a trouble. I removed any-doc as user. I
>> possibly changed something in my regular username so that it
>> is not being recognised as a staff member. I am not able to
>> log in. There appear to be three ways out for me
>>
>> 1. To log in using an username and password of another preexisting account
>> if gnumed has built in account for someone and then create user name for
>> myself.
>> 2. If there is a way to create username without logging in
>> 3. Erase complete system and reinstall.
>> Please help
>
> You can do this in a console:
>
> psql -d gnumed_v16 -U gm-dbo
>
> set default_transaction_read_only to off;
> select gm.create_user('your-user-name', 'your-password');
>
> Karsten
Yes, v16 being the current version for GNUmed 1.1x
If it turned out that any-doc already existed, then the following
select gm.create_user('any-doc', 'any-doc');
will do no harm and will likely instead result in
NOTICE: role "any-doc" is already a member of role "gm-logins"
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 |
gm-dbi | 97582 | 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)
Jim