> Attached is a very hackish patch to implement this. It works like this:
>
> # (assuming you have a primary already running somewhere)
> initdb -D data2 --replica
> $EDITOR data2/postgresql.conf # set primary_conninfo
> pg_ctl -D data2 start
Attached is an updated patch for this. I have changed the initdb option
name per suggestion. The WAL receiver is now started concurrently with
the base backup. There is progress reporting (ps display), fsyncing.
Configuration files are not copied anymore. There is a simple test
suite. Tablespace support is still missing, but it would be
straightforward.
It's still all to be considered experimental, but it's taking shape and
working pretty well.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services