Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
brew install postgres
```
$ brew install postgres
==> Installing postgresql dependency: ossp-uuid
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/ossp-uuid-1.6.2.mavericks.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring ossp-uuid-1.6.2.mavericks.bottle.1.tar.gz
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
OS X provides a uuid.h which conflicts with ossp-uuid's header.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/ossp-uuid/lib
CPPFLAGS: -I/usr/local/opt/ossp-uuid/include
==> Summary
🍺 /usr/local/Cellar/ossp-uuid/1.6.2: 15 files, 228K
==> Installing postgresql
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/postgresql-9.3.4.mavericks.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring postgresql-9.3.4.mavericks.bottle.2.tar.gz
==> Caveats
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
https://github.com/Homebrew/homebrew/issues/issue/2510
To migrate existing data from a previous major version (pre-9.3) of PostgreSQL, see:
http://www.postgresql.org/docs/9.3/static/upgrading.html
When installing the postgres gem, including ARCHFLAGS is recommended:
ARCHFLAGS="-arch x86_64" gem install pg
To install gems without sudo, see the Homebrew wiki.
To have launchd start postgresql at login:
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
Then to load postgresql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Or, if you don't want/need launchctl, you can just run:
postgres -D /usr/local/var/postgres
WARNING: launchctl will fail when run under tmux.
==> /usr/local/Cellar/postgresql/9.3.4/bin/initdb /usr/local/var/postgres
==> Summary
🍺 /usr/local/Cellar/postgresql/9.3.4: 2921 files, 38M
brew install postgres 3.18s user 2.88s system 26% cpu 22.970 total
$ initdb /usr/local/var/postgres -E utf8 (git)-[master]
The files belonging to this database system will be owned by user "usr0600095".
This user must also own the server process.
The database cluster will be initialized with locale "ja_JP.UTF-8".
initdb: could not find suitable text search configuration for locale "ja_JP.UTF-8"
The default text search configuration will be set to "simple".
Data page checksums are disabled.
creating directory /usr/local/var/postgres ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
creating configuration files ... ok
creating template1 database in /usr/local/var/postgres/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
postgres -D /usr/local/var/postgres
or
pg_ctl -D /usr/local/var/postgres -l logfile start
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment