Thread: could not change directory to "/root"

could not change directory to "/root"

From
viju
Date:
Hi

I am new to postgresql.  I am having some weird problems.
Output attached below.  Please any help would be appreciated.

bash-3.2$ createdb test1
could not change directory to "/root"
bash-3.2$ dropdb test
could not change directory to "/root"
bash-3.2$

any recommendations.
Some additional info.  This is on a cenos 5.4 with full admin rights.

bash-3.2$ ps ax | grep post
11329 pts/2    S      0:00 su postgres
11578 pts/2    R+     0:00 grep post
17894 ?        S      0:02 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
17899 ?        Ss     0:00 postgres: logger process                         
17901 ?        Ss     0:00 postgres: writer process                         
17902 ?        Ss     0:00 postgres: wal writer process                     
17903 ?        Ss     0:00 postgres: autovacuum launcher process            
17904 ?        Ss     0:18 postgres: stats collector process                
bash-3.2$

thanks

Re: could not change directory to "/root"

From
Tom Lane
Date:
viju <ace_of_blackstar@yahoo.com> writes:
> I am new to postgresql.� I am having some weird problems.
> Output
>  attached below.� Please any help would be appreciated.

> bash-3.2$
>  createdb test1
> could not change directory to "/root"
> bash-3.2$
> dropdb test
> could not change directory to "/root"
> bash-3.2$

Apparently you did "su postgres" from the root account, so you're
still in root's home directory.  It'd be better to do "su - postgres"
to ensure you've acquired all of the postgres account's environment.
Reading "man su" might help you out here.

            regards, tom lane