To test streaming replication, I would like to create a second Postgres instance on the same machine. The idea is that if it can be done on the test server, then it should be tr
On Debian based distros you could use pg_createcluster instead of initdb:
pg_createcluster
initdb
$ pg_createcluster -u [user] -g [group] -d /path/to/data -l /path/to/log -p 5433
Also pg_ctlcluster is an alternative to pg_ctl.
pg_ctlcluster
pg_ctl