I am thinking about testing enviroment here, and gotta setup temporary instalation of postgres for that. More than one, because software operates on few different connections, to different databases. I know I can do it under same user, just by changing PGDATA/PGPORT before initdb gets to run. But will it be safe otherwise ?
yes, no problem with that. for me it was just:
initdb -D /tmp/data1 vim /tmp/data1/postgresql.conf +/port pg_ctl start -D /tmp/data1
initdb -D /tmp/data2 vim /tmp/data2/postgresql.conf +/port pg_ctl start -D /tmp/data2