Skip site navigation (1) Skip section navigation (2)

Re: Question about initdb -t

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question about initdb -t
Date: 2000-04-02 21:18:39
Message-ID: Pine.LNX.4.21.0004021701270.373-100000@localhost.localdomain (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Oliver Elphick writes:

> The man page for initdb says that the -t option will overwrite the template1
> database with the up-to-date structure and suggests that this is the way to
> upgrade to a newer release

I believe it's wrong. The only thing -t does is fill up your template1
database with good data, say if you acidentally deleted all records from a
system table. It is not very useful generally, I think.

> How does this relate to pg_upgrade?

It doesn't. I have never used pg_upgrade but from looking at it I believe
what it does is create a new database schema (using pg_dumpall
information) and then instead of using COPY to get your data back in it
merely moves over the old on disk files for each table. The only thing
this buys you is time, it doesn't work around the various pg_dump
deficiencies or having to shut down the database, etc.

> Is it necessary to do a pg_dump?

Not unless you have something interesting in template1 you'd like to

> If not, is there a danger of new oids in template1 overwriting old
> oids in user data?


> (I am not clear whether oids are unique to a database or to the whole
> PostgreSQL installation.)


Peter Eisentraut                  Sernanders väg 10:115
peter_e(at)gmx(dot)net                   75262 Uppsala            Sweden

In response to

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2000-04-02 21:18:55
Subject: Re: Call for porting reports
Previous:From: Peter EisentrautDate: 2000-04-02 21:18:21
Subject: Re: Docs refreshed

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group