Thread: newbie-problem
Hi folks! :-) I have a problem with my first steps with postgresql. I installed the database-server on my LINUX-box (debian potato) and wanted to try out the first operations with psql. When I call psql, I get the following error message: Connection to database 'template1' failed FATAL1: SetUserId: user 'bernard' is not in 'pg_shadow' I don't know what to do. Sure, this is a stupid question. But it is really my first contact with a database. Thank you very much! Bernard -- Bernard Reissberg http://www.linux-services.net Linux & Open Source... my way!
On Wed, 2002-01-30 at 10:28, Bernard Reissberg wrote: > Hi folks! :-) > > I have a problem with my first steps with postgresql. I installed > the database-server on my LINUX-box (debian potato) and wanted to > try out the first operations with psql. When I call psql, I get the > following error message: > > Connection to database 'template1' failed > FATAL1: SetUserId: user 'bernard' is not in 'pg_shadow' When postgresql is first installed, the only user is the user specified when initdb was run (usually "postgres"). (PostgreSQL users are NOT the same as system users, though there may be a coincidence of names, deliberately or otherwise.) When you call psql, PostgreSQL defaults to a user of the same name as your system (login) name. Since that does not yet exist, you have a failure. You need to connect to PostgreSQL as user "postgres" and create a PostgreSQL user "bernard". $ psql -U postgres template1 [instead of using "-U postgres" you can define PGUSER=postgres and export it before calling psql] template1=# CREATE USER bernard CREATEDB CREATEUSER; CREATE USER Alternative method using Unix commands: $ su - postgres $ createuser --createdb --adduser bernard Both these examples give bernard the right to create databases and create new users. To begin with, the database has completely open access. You will need to edit $PGDATA/pg_hba.conf to define who can connect to the databases and how they are to be authenticated. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C "The Lord knoweth how to deliver the godly out of temptations, and to reserve the unjust unto the day of judgment to be punished;" II Peter 2:9
Attachment
When you connect to postgres without using option -u, it tries to connect to postgres with current user (of linux). It seems that you are logged on to linux with user "bernard". It is trying to connect to database with this user id but it is not getting that username in postgres user database... You need to create one user from linux shell prompt .. with this command createuser bernard with password <yourpassword> HTH Denis ----- Original Message ----- From: "Bernard Reissberg" <bernard.reissberg@web.de> To: <pgsql-novice@postgresql.org> Sent: Wednesday, January 30, 2002 3:58 PM Subject: [NOVICE] newbie-problem > Hi folks! :-) > > I have a problem with my first steps with postgresql. I installed > the database-server on my LINUX-box (debian potato) and wanted to > try out the first operations with psql. When I call psql, I get the > following error message: > > Connection to database 'template1' failed > FATAL1: SetUserId: user 'bernard' is not in 'pg_shadow' > > I don't know what to do. Sure, this is a stupid question. But it is > really my first contact with a database. > > Thank you very much! > > Bernard > > > > -- > Bernard Reissberg > > http://www.linux-services.net > > Linux & Open Source... my way! > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org