Problem with starting up

Started by Nandu Gargabout 24 years ago2 messagesgeneral
Jump to latest
#1Nandu  Garg
focussed@rediffmail.com

Hi All

I am new to pgsql and just now started with it. It is installed on our Linux Machine.
I am referring an online Doc and doing things. Now I have following prblems at my level.

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

When I issued following command
$createdb mydb
Connection to database 'template1' failed.
FATAL 1: SetUserId: user 'amol' is not in 'pg_shadow'

'amol' is my actual user on linux. Now What can be the problem.. Also let me know what are the starting command on Linux for pgsql.
Do I have to connect using 'postgres' user ..what is the password by default

Amol

#2Holger Krug
hkrug@rationalizer.com
In reply to: Nandu Garg (#1)
Re: Problem with starting up

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