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