[root@newdell data]# pg_ctl --log /tmp/pg.log start pg_ctl: cannot be run as root Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.
Then i cahnged the user as postgres
[root@newdell data]# su postgres bash-3.00$ pg_ctl --log /tmp/pg.log start pg_ctl: no database directory specified and environment variable PGDATA unset Try "pg_ctl --help" for more information. bash-3.00$
Please help me
you should 'su - postgres' instead of 'su postgres' and try again. probably PGDATA is not getting set because of that.
regds mallah.
from man page of su -------------------
su is used to become another user during a login session. Invoked without a username, su defaults to becoming the super user. The optional argument - may be used to provide an environment similar to what the user would expect had the user logged in directly.