Re: Initial user and RedHat 8.0 - Mailing list pgsql-novice

From Jason Earl
Subject Re: Initial user and RedHat 8.0
Date
Msg-id 871y32e9yy.fsf@npa01zz001.simplot.com
Whole thread Raw
In response to Initial user and RedHat 8.0  ("Joel FYAN" <jrfyan@msn.com>)
List pgsql-novice
"Joel FYAN" <jrfyan@msn.com> writes:

> Hello,
>
>  
>
> I ran initdb as the unprivileged user 'postgres'.  The output of the
> initialization suggested that the superuser account for the db
> cluster would be 'postgres'.
>
>  
>
> Next, I started the db server as per the instructions in the initdb
> output: /usr/bin/postmaster -D /var/lib/pgsql/data.  The output to
> the terminal indicated that the db was started.
>
>  
>
> Finally, I attempted to connect to the db with the postgres user as
> follows: postgres$ psql -U postgres.  I received the following
> message: FATAL: Database "postgres" does not exist in the system
> catalog.

If psql isn't given the name of a database to connect to it tries to
use the username.  You either need to use something like:

psql template1 -U postgres

which will connect you to the built-in "template1" database or you
need to create a database with a different name using "createdb".
Type "man createdb" for more information.

> I tried using psql -u which lead to an explicit prompt for user name
> and password.  I entered postgres and then the password for the
> system user.  The same message was displayed.

The problem stems from the database being missing, not from having
incorrect credentials.

> Any insight would be appreciated.

Depending on how you installed PostgreSQL you probably should consider
testing out the included init scripts that start and stop PostgreSQL.
Starting PostgreSQL from the command line is fine for testing, but it
is not what you need for a production server.

I hope that was helpful, please feel free to write back if you have
more questions.

Jason

pgsql-novice by date:

Previous
From: Desmond Coughlan
Date:
Subject: Re: Can't read input file
Next
From: Jason Earl
Date:
Subject: Re: Learning Plpgsql ??