Homebrew does this automatically: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/postgresql.rb#L75-L79