Bob Parkinson <rwp@biome.ac.uk> writes:
omni.ac.uk> export PGDATA2=/public_searchable_0
omni.ac.uk> initlocation PGDATA2
...
omni.ac.uk> createdb 'testdb' -D 'PGDATA2'
> ERROR: The database path 'PGDATA2' is invalid. This may be due to a
> character that is not allowed or because the chosen path isn't permitted
> for databases
The backend will not take 'PGDATA2' as a location unless that
environment variable exists in the *postmaster's* environment.
Creating it in the client's environment won't do (except for
initlocation, which is only a shell script).
Don't forget to modify your startup scripts so that PGDATA2
is established for the postmaster on future restarts, too.
regards, tom lane