Search Postgresql Archives

Re: Fixing the loss of 'template1'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, March 07, 2012 6:23:42 am Martin Gregorie wrote:

> 
> Question
> ========
> Is it possible to reinstate 'template1' and all its works without
> reinitialising the database from scratch. It was suggested to me that
> running "initdb" might fix it while leaving my data in place though my
> source was uncertain about its success. Would this work or is there a
> better way to restore 'template1' in a populated database system?

So the question is, did you have your template1 customized in the 8.4 
installation and are you looking to transfer those added items to the 9.1 
installation?  Some information on the template system can be found here:

http://www.postgresql.org/docs/9.1/interactive/manage-ag-templatedbs.html

As others have said you can recreate a bare template1 from template0.  If you 
had not customized template1 that should do.  If you had customized it:

On the chance that the 8.4 cluster is still up and running you could just do a 
pg_dump of template1 on that cluster and load it into the new cluster. If the 
8.4 cluster is not running you can go to your pg_dumpall file and get the 
template1 objects from there. Search for the  \connect template1 string and look 
for the SQL commands until the next \connect string.


> 
> 
> Martin

-- 
Adrian Klaver
adrian.klaver@xxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux