Text
Installing postgres with Brew in MacOSX
Homebrew is wonderful but sometimes it can be a little headache. For example, if you’ve created a rake task with ruby that assume a role called postgres (by default), probably if you installed with brew you won’t have it. Brew get your system user and unless your name would be postgres, you have to create it. For this reason, I’m going to write the easy steps to create a new role with admin privileges. Remembering, you did:
brew install postres
initdb /usr/local/var/postgres
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plistIf you need a gem for posgres do:
env ARCHFLAGS="-arch x86_64" gem install pgInstall Instrumentation, in my case (postgres version 9.0.4):
psql -d postgres < /usr/local/Cellar/postgresql/9.0.4/share/postgresql/contrib/adminpack.sqlAt this moment, you installed postgress (it’s only a note). Ok, let’s create a new role:
psql -d postgresWith this command, you’ll see all roles created:
postgres-# \duWe create a new user called postgres like this way:
postgres=# CREATE ROLE postgres SUPERUSER CREATEDB CREATEROLE LOGIN;And that’s all. If you list all users again you’ll see that a new user has been created.
-
keynotetis8 liked this
-
emileeyou89 liked this