Re: initdb on build machine and moving to production machine - Mailing list pgsql-general

From Tom Lane
Subject Re: initdb on build machine and moving to production machine
Date
Msg-id 13268.979258425@sss.pgh.pa.us
Whole thread Raw
In response to initdb on build machine and moving to production machine  (oberpwd@anubis.network.com (Wade D. Oberpriller))
List pgsql-general
oberpwd@anubis.network.com (Wade D. Oberpriller) writes:
> I want to be able to do an initdb on a build machine and then copy this new
> database to a production machine and run with it. One thing I have noticed is
> that initdb needs an absolute path, so if I copy the database it needs to
> reside in an identical location as where it was initialized.

Have you tried it?  AFAIK the -D path is not actually stored anywhere,
so it seems to me this would work, assuming that (a) both machines are
of identical architectures (in fact I strongly suggest you be running
identical postgres executables), and (b) you shut down the postmaster
on the source machine while you make a copy of the $PGDATA tree.
The *whole* $PGDATA tree, mind you, don't try to be choosy.  But you
should be able to restore that directory tree to a different path
if you want.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: Loading optimization
Next
From: "rob"
Date:
Subject: Re: Selective Auto-Timestamp [using triggers?]