Обсуждение: Creating a user fails

Поиск
Список
Период
Сортировка

Creating a user fails

От
"Werner Schalk"
Дата:
Hi,

I'm new to postgresql and tried
to install the dbms. I did a
"./configure --prefix=/usr/local/postgresql-7.2.1 \
--enable-nls=de --with-perl", "make"
and of course "make install".
I created a new user using the
command "useradd -g postgres -d \
/var/lib/postgres -s /bin/bash postgres",
created the directories /var/lib/postgres
and /var/lib/postgres/data, made a chown
(chown -R postgres /var/lib/postgres) on
them and sent a "initdb". This all works
fine and I can even start the database.
I also created a file .bash_profile which
looks like this:

PGBASE=/usr/local/postgresql-7.2.1
PGDATA=/var/lib/postgres/data
PGLIB=$PGBASE/lib
PGBIN=$PGBASE/bin
PGUSER=postgres

PATH=$PATH:$PGBIN

export PATH

export PGDATA PGLIB PGUSER

When I try to create a user I get the
message

postgres@diebels:~$ createuser -D -A -P werner
env: /usr/lib/postgresql/bin/readpgenv: No such file or directory
Could not execv /usr/lib/postgresql/bin/createuser

Why the hell is he trying to use /usr/lib/postgresql and
not the one I gave to ./configure? I mean I even
don't find a file called readpgenv??? What's wrong
here?

Thanks a lot in advice!
Werner


Re: Creating a user fails

От
Tom Lane
Дата:
"Werner Schalk" <werner_schalk@gmx.de> writes:
> postgres@diebels:~$ createuser -D -A -P werner
> env: /usr/lib/postgresql/bin/readpgenv: No such file or directory
> Could not execv /usr/lib/postgresql/bin/createuser

> Why the hell is he trying to use /usr/lib/postgresql and
> not the one I gave to ./configure?

Check your PATH.  I bet there is some preinstalled createuser
script that you are invoking, and not the one in
/usr/local/postgresql-7.2.1/bin.

            regards, tom lane