Re: [GENERAL] recovering a "lost" database - Mailing list pgsql-general

From Bruce Momjian
Subject Re: [GENERAL] recovering a "lost" database
Date
Msg-id 199912201816.NAA24753@candle.pha.pa.us
Whole thread Raw
In response to recovering a "lost" database  (Jeff Hoffmann <jeff@propertykey.com>)
List pgsql-general
> i have a database that was "lost" -- the database is still there (i can
> see the files on disk in the database's directory), but when i try to
> connect to the database, it says that it doesn't exist in pg_database.
> what happened is that the database got dropped while the drive with the
> data on it was unmounted, but now that i thought about it, it would be
> nice to have a backup of it if i can get it.  is there a way that i can
> manually add it to the pg_database table (and are there other tables i
> have to mess with?) so i can access it again?

Go into template1 database and insert a new row into the pg_database
table for the missing databases.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Thomas Reinke
Date:
Subject: Re: [GENERAL] copy command -- foiled by pg_atoi
Next
From: Ed Loehr
Date:
Subject: Re: [GENERAL] copy command -- foiled by pg_atoi