Monday, August 23, 2010

Setting up PostgreSQL - failed

I am now setting up PostgreSQL just installed.

1. Give a password for the (Ubuntu)user "postgres" (created by PostgreSQL).
$ sudo passwd postgres
[sudo] password for socrateos: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

2. Create a new database and add myself as a new database user.
$ su postgres 
$ psql createdb testdb
sh: psql: not found
Oops! Changing of ~/.profile did not work.
So I modified /etc/environment to make a system-wide change.
PATH="/opt/PostgreSQL/9.0/bin;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
Well, I am still having a problem accessing psql as user postgres.
$ psql -V
psql (PostgreSQL) 9.0beta4
contains support for command-line editing
$ su postgres
passwd:
$ psql -V
sh: psql: not found
$ echo $PATH
/opt/PostgreSQL/9.0/bin;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
$ /opt/PostgreSQL/9.0/bin/psql -V
psql (PostgreSQL) 9.0beta4
contains support for command-line editing
I am too newbie to know what's going on here. Perhaps something to do with rights.
I am giving up EnterpriseDB version of PostgreSQL.

No comments:

Post a Comment