Thread: psql won't start

psql won't start

From
"Diego A. Puertas F."
Date:
I have compiled succesfully PostgreSQL 7.0.2, and I had ran psql at least
twice and built a database without problem.


Now psql is not starting and throws the following message:

 psql: FATAL 1:  Database "postgres" does not exist in the system catalog.


So, what's going on?


Diego A. Puertas Fernández


Re: psql won't start

From
Thomas Good
Date:
On Thu, 9 Nov 2000, Diego A. Puertas F. wrote:

> I have compiled succesfully PostgreSQL 7.0.2, and I had ran psql at least
> twice and built a database without problem.
>
>
> Now psql is not starting and throws the following message:
>
>  psql: FATAL 1:  Database "postgres" does not exist in the system catalog.
>
>
> So, what's going on?

Diego,

You are missing an argument: the database name...

$ psql <dbname>
For exam:  $ psql template1

--------------------------------------------------------------------
               SVCMC - Center for Behavioral Health
--------------------------------------------------------------------
Thomas Good                          tomg@ { admin | q8 } .nrnet.org
IS Coordinator / DBA                 Phone: 718-354-5528
                                     Fax:   718-354-5056
--------------------------------------------------------------------
Powered by:  PostgreSQL     s l a c k w a r e          FreeBSD:
               RDBMS       |---------- linux      The Power To Serve
--------------------------------------------------------------------


Re: psql won't start

From
Gerhard Kroder
Date:
Thomas Good wrote:
>
> On Thu, 9 Nov 2000, Diego A. Puertas F. wrote:

> > Now psql is not starting and throws the following message:
> >
> >  psql: FATAL 1:  Database "postgres" does not exist in the system catalog.
> >
> >
> > So, what's going on?
>
> Diego,
>
> You are missing an argument: the database name...
>
> $ psql <dbname>
> For exam:  $ psql template1


hmm, IMHO not necessarily. At least here psql connects to a default
database, which is template1 unless you set it otherwise....

My guess: there is no database at all, just the system. You need to
initialize one first (initdb). On my Debian System it gets initialized
when installing PostgreSQL from Debian Packages.


--
Gerhard Kroder

RE: psql won't start

From
"Robert D. Nelson"
Date:
>hmm, IMHO not necessarily. At least here psql connects to a default
>database, which is template1 unless you set it otherwise....

Typically, "psql" by itself will attempt to connect to a database with the
current users name. If I login as ronelson, then type psql, it will attempt
to connect me to a database called ronelson. My guess is that the original
poster was logged on as postgres, but only had a template1 database.


Rob Nelson
rdnelson@co.centre.pa.us


Re: psql won't start

From
Thomas Good
Date:
On Thu, 9 Nov 2000, Gerhard Kroder wrote:

> > $ psql <dbname>
> > For exam:  $ psql template1
>
>
> hmm, IMHO not necessarily. At least here psql connects to a default
> database, which is template1 unless you set it otherwise....
>
> My guess: there is no database at all, just the system. You need to
> initialize one first (initdb). On my Debian System it gets initialized
> when installing PostgreSQL from Debian Packages.

Hallo Gerhard,

This is not the case on RedHat, Slackware, FreeBSD or UnixWare.
Don't know about SuSe(?)

On these systems psql needs an arg else it complains that the
database 'tomg' does not exist.  ;-)

Ciao

--------------------------------------------------------------------
               SVCMC - Center for Behavioral Health
--------------------------------------------------------------------
Thomas Good                          tomg@ { admin | q8 } .nrnet.org
IS Coordinator / DBA                 Phone: 718-354-5528
                                     Fax:   718-354-5056
--------------------------------------------------------------------
Powered by:  PostgreSQL     s l a c k w a r e          FreeBSD:
               RDBMS       |---------- linux      The Power To Serve
--------------------------------------------------------------------


Re: psql won't start

From
Gerhard Kroder
Date:
"Robert D. Nelson" wrote:
>
> >hmm, IMHO not necessarily. At least here psql connects to a default
> >database, which is template1 unless you set it otherwise....
>
> Typically, "psql" by itself will attempt to connect to a database with the
> current users name.

you are right, this is also documented in psql's man page. i didn't
know, because it works works different here. debian's way is a little
different... just took a look on README's, using template1 is currently
the package maintainers setting, and debian's policy comes in touch,
too.


> was logged on as postgres, but only had a template1 database.

(what would be ok on debian systems). i'm novice myself, so no more
ideas....

--
Gerhard Kroder

Re: psql won't start

From
"Diego A. Puertas F."
Date:
Thomas post did solve the problem, I think I'm still a little influenced
by the mysql way :-)

El 09/11/00, Diego A. Puertas F. escribió:

> I have compiled succesfully PostgreSQL 7.0.2, and I had ran psql at least
> twice and built a database without problem.
>
>
> Now psql is not starting and throws the following message:
>
>  psql: FATAL 1:  Database "postgres" does not exist in the system catalog.
>
>
> So, what's going on?
>
>
> Diego A. Puertas Fernández
>