Mike Mascari <mascarm(at)mascari(dot)com> writes:
> How about:
> export PGDATA2=/opt/postgres/data
> initlocation PGDATA2
> createdb -D PGDATA2 mydb
Note also that the environment variable PGDATA2 must be defined in the
*postmaster*'s environment, not only your shell environment. This is
a crude (and ugly) way of letting the DBA control which directories may
be used as alternate locations --- only what he's listed in the
postmaster's environment may be used.
regards, tom lane