I'm new to unix and having trouble running initdb with postgresql. I installed postgres via homebrew with "brew install postgres", and have attempted to run the initdb command as follows:
initdb /usr/local/var/postgres The files belonging to this database system will be owned by user "philhowie". This user must also own the server process.
The database cluster will be initialized with locale en_NZ.UTF-8. The default database encoding has accordingly been set to UTF8. The default text search configuration will be set to "english".
creating directory /usr/local/var/postgres ... initdb: could not create directory "/usr/local/var/postgres": Permission denied
Is postgresql supposed to run as a different user account? In that case, how do I set that up? I can't run this command as root it seems.
Thanks for your help!