Re: Problem with starting up - Mailing list pgsql-general

From Holger Krug
Subject Re: Problem with starting up
Date
Msg-id 20020111131037.A26764@dev12.rationalizer.com
Whole thread Raw
In response to Problem with starting up  ("Nandu Garg" <focussed@rediffmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Nandu Garg"
Date:
Subject: Problem with starting up
Next
From: Fariba Noorbakhsh
Date:
Subject: XML document!