Thread: database does not exist in system catalog

database does not exist in system catalog

From
"Kathi Arthur"
Date:
Please bear with me for a stupid new-user question.  I've tried to solve my problem by looking at the online documentation, FAQs and archived list servs (all very helpful!).  But after most of the night Friday and most of last night, I still don't get it...
 
I have a database that is already created and sitting out there.  I can't access it (Fatal 1:  Database "my db" does not exist in the system catalog").
 
I don't want to run CREATE DATABASE because the table schemas I want already exist.  I don't care about the data -- just the schemas and attributes.
 
Can you help me figure out what steps I need to go through to add this db to the data dictionary (system catalog)?  Right now, all I can access is template1.
 
I'm running PostgreSQL 7.0.2 on an alpha running FreeBSD.
 
Help!  TIA.
 
Kathi Arthur
Colorado Mountain College

Re: database does not exist in system catalog

From
"Kathi Arthur"
Date:
Len --
 
No, the db is actually called "bullprod" -- I just didn't want to explain the history behind THAT name!
 
I'll play around with the pg_dumpall but I think I have bigger problems than that...
 
Thanks for the hint!
 
-- Kathi
----- Original Message -----
Sent: Monday, August 06, 2001 2:07 PM
Subject: Re: [GENERAL] database does not exist in system catalog

Is your database really called "my db" with the space?  I don't think that is going to work.  You might try just "db" to see if that works.  If it doesn't, you might try and do a pg_dumpall which will dumb ALL of the databases it knows about and then you can use the resulting file to rename "my db" to "mydb" and reload it.  I don't know if that's the problem, but it's worth a shot.
 
len morgan
----- Original Message -----
Sent: Monday, August 06, 2001 2:47 PM
Subject: [GENERAL] database does not exist in system catalog

Please bear with me for a stupid new-user question.  I've tried to solve my problem by looking at the online documentation, FAQs and archived list servs (all very helpful!).  But after most of the night Friday and most of last night, I still don't get it...
 
I have a database that is already created and sitting out there.  I can't access it (Fatal 1:  Database "my db" does not exist in the system catalog").
 
I don't want to run CREATE DATABASE because the table schemas I want already exist.  I don't care about the data -- just the schemas and attributes.
 
Can you help me figure out what steps I need to go through to add this db to the data dictionary (system catalog)?  Right now, all I can access is template1.
 
I'm running PostgreSQL 7.0.2 on an alpha running FreeBSD.
 
Help!  TIA.
 
Kathi Arthur
Colorado Mountain College

Re: database does not exist in system catalog

From
Tom Lane
Date:
What do you get from "psql -l", or from "select * from pg_database"
after connecting to template1?

            regards, tom lane

Re: database does not exist in system catalog

From
"Kathi Arthur"
Date:
Len, Tom, et al --
 
When I'm connected to template1, \l only shows template1.  In the "base" subdirectory, I do have the template1 subdir as well as the bullprod subdir with all the schemas I want.  So what am I missing to make THAT db part of the system catalog (data dictionary)?  I'm sure it's very obvious...  Just not to me!
 
-- Kathi
----- Original Message -----
Sent: Monday, August 06, 2001 2:28 PM
Subject: Re: [GENERAL] database does not exist in system catalog

Kathi;
 
Thank you, I don't think I WANT to know where the name came from.  I believe there is a psql command ( \l ) that will list all database names the Postgres is aware of.  I believe that you can also look in the postgres database directory under the "base" subdirectory and see another directory for each database.  Becareful changing those names though.  You might at least find that you inadvertantly created it with a different name than you think.  Maybe the SYSTEM needed an explaination for the name!  :-)
 
Good luck,
 
len

Re: database does not exist in system catalog

From
"P. Dwayne Miller"
Date:
How did you create this database?

Kathi Arthur wrote:

> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_00B0_01C11E7E.4FFBA910
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> Please bear with me for a stupid new-user question.  I've tried to solve my=
>  problem by looking at the online documentation, FAQs and archived list ser=
> vs (all very helpful!).  But after most of the night Friday and most of las=
> t night, I still don't get it...
>
> I have a database that is already created and sitting out there.  I can't a=
> ccess it (Fatal 1:  Database "my db" does not exist in the system catalog").
>
> I don't want to run CREATE DATABASE because the table schemas I want alread=
> y exist.  I don't care about the data -- just the schemas and attributes.
>
> Can you help me figure out what steps I need to go through to add this db t=
> o the data dictionary (system catalog)?  Right now, all I can access is tem=
> plate1.
>
> I'm running PostgreSQL 7.0.2 on an alpha running FreeBSD.
>
> Help!  TIA.
>
> Kathi Arthur
> Colorado Mountain College
> karthur@coloradomtn.edu
>
> ------=_NextPart_000_00B0_01C11E7E.4FFBA910
> Content-Type: text/html; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1">
> <META content=3D"MSHTML 5.50.4616.200" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT face=3DArial size=3D2>Please bear with me for a stupid new-user=
> =20
> question.  I've tried to solve my problem by looking at the online=20
> documentation, FAQs and archived list servs (all very helpful!).  But =
> after=20
> most of the night Friday and most of last night, I still don't get=20
> it...</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>I have a database that is already created =
> and=20
> sitting out there.  I can't access it (Fatal 1:  Database "my db"=
>  does=20
> not exist in the system catalog").</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>I don't want to run CREATE DATABASE becaus=
> e the=20
> table schemas I want already exist.  I don't care about the data -- ju=
> st=20
> the schemas and attributes.</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>Can you help me figure out what steps I ne=
> ed to go=20
> through to add this db to the data dictionary (system catalog)?  Right=
>  now,=20
> all I can access is template1.</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>I'm running PostgreSQL 7.0.2 on an alpha r=
> unning=20
> FreeBSD.</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>Help!  TIA.</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>Kathi Arthur</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>Colorado Mountain College</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2><A=20
> href=3D"mailto:karthur@coloradomtn.edu">karthur@coloradomtn.edu</A></FONT><=
> /DIV></BODY></HTML>
>
> ------=_NextPart_000_00B0_01C11E7E.4FFBA910--


Re: database does not exist in system catalog

From
Tom Lane
Date:
"Kathi Arthur" <karthur@coloradomtn.edu> writes:
> When I'm connected to template1, \l only shows template1.  In the "base" su=
> bdirectory, I do have the template1 subdir as well as the bullprod subdir w=
> ith all the schemas I want.

Perhaps you should explain exactly what you did to get into this state.
I have a nasty feeling that you tried something like copying the
$PGDATA/base/bullprod subtree out of one database installation and into
another one.  That isn't going to work --- the main problem being that
the transaction status info (pg_log) didn't come with it.

BTW, what Postgres version are you running?  I can tell already that
it's not 7.1, but I'm wondering just how old it is...

            regards, tom lane