Re: newbie-problem - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: newbie-problem
Date
Msg-id 1012390182.17978.238.camel@linda
Whole thread Raw
In response to newbie-problem  (Bernard Reissberg <bernard.reissberg@web.de>)
List pgsql-novice
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

pgsql-novice by date:

Previous
From: Raphael Bauduin
Date:
Subject: owner of a table
Next
From: Oliver Elphick
Date:
Subject: Re: owner of a table