[clug] postgres

Alastair D'Silva alastair at newmillennium.net.au
Tue Jul 13 22:36:27 GMT 2004

On Tue, 2004-07-13 at 19:21, Adrian Blake wrote:
> Is there anyone who is a postgres wizard, wizardy is what I need.
> My computer failed without a recent dump of the postgres databases.
> I have recovered all the files in the /var/lib/pgsql  directory.
> The computer is working again, same linux version, Mandrake 9.0, same 
> postgres version 7.2 etc.
> psql -l reports only:
>          List of databases
>     Name    |  Owner   | Encoding
> -----------+----------+-----------
>   template0 | postgres | SQL_ASCII
> (1 row)
>  From what I understand template0 is a database of the databases that 
> exist.
> Some guidance on recovery would be appreciated.
> Adrian
> -- 

Hi Adrian,

'template0' is just a template database, which the system copies to
'template1' which is then copied to create additional databases (you can
modify template1 if you want all future dbs you create to contain a
certain structure).

To recover your data, you'll need to make sure that the contents of your
data directory are intact. You'll really need some expert advice on
recovering the database - I suggest the PostgreSQL mailing lists.

If you've reinstalled the package after restoring your files, you've
likely trampled all over the data that tells the db software where the
databases are. Try installing the package first, shutting down the db,
then restoring your files.

PS. pg_dumpall is your friend.

Alastair D'Silva		mob: 0423 762 819
Networking Consultant		fax: 0433 141 032
New Millennium Networking	web: http://www.newmillennium.net.au

More information about the linux mailing list