Setting up a development environment on a new machine, brew installed postgres. Now I need to initdb for the first time, which directory should i specify for this command?
Asked
Active
Viewed 2,450 times
1
jbk
- 1,451
- 15
- 34
-
Anything you choose. That's why it is a parameter... – wildplasser Nov 21 '16 at 00:38
2 Answers
2
Assuming you're on OS X, given "brew", then:
If you intend to run the postgres server under your own user account, put it somewhere like
/Users/MyUserName/Library/postgres_data.If you intend to run it from
launchdas a system service, as a dedicated postgres user, put it somewhere in/Library/.
However, Homebrew takes this out of your hands a bit with brew services:
brew tap homebrew/services
which I recommend using. I don't have a Mac and the docs appear to be nonexistent for this, but it looks like it's as simple as:
brew services start postgres
If not, the interactive help will probably tell you what you need to do.
Craig Ringer
- 283,586
- 65
- 635
- 730