On Fri, Jan 11, 2002 at 11:35:12AM -0000, Nandu Garg wrote:
> when I issue following command at my prompt It gives me following error
> $psql
> Connection to database 'amol' failed.
> FATAL 1: Database amol does not exist in pg_database
If you do not give a database name, your user name is taken as default. psql
tries to connect to database 'amol' and fails.
> When I issued following command
> $createdb mydb
> Connection to database 'template1' failed.
> FATAL 1: SetUserId: user 'amol' is not in 'pg_shadow'
If your Linux system is correctly installed `man createdb' should give
you all the necessary information. For creating new databases you have
to be a valid PostgreSQL user with CREATE DATABASE permission.
Initially there is only one user, named `postgres'. So calling
$ createdb -U postgres newdb
should work fine. (But look at the man page first!)
To create a new user, e.g. yourself, look at `man createuser' and `man
create_user'. E.g. the following should work fine:
$ psql -U postgres newdb
newdb=# CREATE USER amol;
CREATED
newdb=# \q
$ psql newdb # now you can connect as yourself !
> Do I have to connect using 'postgres' user ..what is the password by default
No password by default.
--
Holger Krug
hkrug@rationalizer.com