Hi,
maybe I am a bit stupid, though it is quite a long time since I had to
administer. However, the problem is such:
I'd like to put the GnuMed (http://www.gnumed.org) repository onto a separate
database. Therefore I created a script gnumed_install.sql that should do the
tirck. Below the beginning of the script creating database owner/dba and
connecting to it as freshly created user and creating the database. I make it
run as postgres (superuser) on template1.
**
-- Thiemo Kellner, 2003-08-09, thiemo@thiam.ch
-- This code may be used or altered freely. I do not take any liability.
-- put the lines below (without line comment --) into pg_hba.conf
--host GNUMED GNUMED_DBA 0.0.0.0 0.0.0.0 md5
--host template1 GNUMED_DBA 0.0.0.0 0.0.0.0 md5
-- force terminate + exit(3) on errors if non-interactive
\unset ON_ERROR_STOP
-- Create a user the data base belongs to
drop user GNUMED_DBA;
create user GNUMED_DBA
encrypted password 'xyz'
createuser
createdb
;
\set ON_ERROR_STOP 1
-- Create the data base that is to contain the GnuMed repository
-- as the GnuMed repository owner (gnumed_dba)
\connect template1 GNUMED_DBA
create database GNUMED;
-- Revoke the right to create data bases from the the GnuMed repository owner
-- (gnumed_dba). One data base is enough ;)
\connect template1 postgres
alter user GNUMED_DBA
nocreatedb
;
-- remove the line below from pg_hba.conf
--host template1 GNUMED_DBA 0.0.0.0 0.0.0.0 md5
\echo Please change pg_hba.conf such that gnumed_dba only may connect to
\echo its own repository
-- Populate the GnuMed repository with its objects
***
The script create the new user but connecting with it fails:
template1=# \i gnumed_install.sql
DROP USER
CREATE USER
Passwort:
psql:gnumed_install.sql:24: \connect: FATAL: Password authentication failed
for user "GNUMED_DBA"
I neither can connect with this user by
# psql -d template1 -h nyffeltrach -U GNUMED_DBA
giving me the same error:
Passwort:
psql: FATAL: Password authentication failed for user "GNUMED_DBA"
Does anybody have an idea what I am doing wrong? All my other users have been
created with the same statement options.
Cheers,
Thiemo
--
root ist die Wurzel allen Übels