Re: RFC: common database policy/infrastracture

2004-12-17 Thread Karsten Hilbert
> >but something to point out:  dbconfig-common already performs the
> >administrative actions needed to set up the database and database user
Well, see, the GnuMed bootstrapping does a lot more advanced
things regarding "the database user". There's users and groups
with varying levels of access to the database.

However, if dbconfig-common creates the admin account we just
use it. We can also deal with the fact that the database is
pre-created, no problem.

> 2. From the application point of view I could ask people to
>include an option which prevents the bootstrap script from
>doing the work which is just done.  I guess this is no big deal
>for the very responsive authors.
Agree. We might need to double-check but I think we are in
good shape on that already.

> >for the admin pass, it should be configurable globally whether or not
> >the admin password is stored at all.
I think you need to be very clear on what you mean here. There
is an admin account for *PostgreSQL* (eg. postgres in most
cases) but there's also an admin account for the database
"gnumed" inside PostgreSQL (usually called gm-dbowner). The
latter one owns all objects in that database and grants rights
to other user groups.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




Re: Help wanted for packaging postgresql application

2003-05-26 Thread Karsten Hilbert
Andreas,

> For the next problem I have no real clue for a solution.  The
> bootstrap method does access the database as the newly created user
> this requires a change of the PostgreSQL configuration.  To make the
> problem clear look at the following shell script:
> 
>#!/bin/sh
>TUSER=mytestuser
>PASSW=jippi
> 
>HASUSER=`echo "SELECT count(*) FROM pg_user WHERE usename = '"${TUSER}"'" 
> | \
>   psql template1 | \
>   grep "^[[:space:]]*[0-9]\+" | \
>   sed "s/^[[:space:]]*\([0-9]\+\)/\1/"`
> 
>if [ $HASUSER -eq 0 ] ; then
>   echo "CREATE USER ${TUSER} WITH PASSWORD '"${PASSW}"' CREATEDB" | \
>psql template1
>else
>   echo "User $TUSER exists."
>fi
> 
>psql --username ${TUSER} --password template1