De uma discussão offline, eu entendi que você estava tentando instalar o postgresql no macOS.
Na documentação :
Homebrew
PostgreSQL can also be installed on macOS using Homebrew. Please see the Homewbrew documentation for information on how to install packages.
- Instale o homebrew : %código%
- Instale o postgresql do terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
.
Minha saída:
$ brew install postgresql
Updating Homebrew...
==> Auto-updated Homebrew!
==> Downloading https://homebrew.bintray.com/bottles/postgresql-9.6.3.sierra.bot
######################################################################## 100.0%
==> Pouring postgresql-9.6.3.sierra.bottle.tar.gz
==> Using the sandbox
==> /usr/local/Cellar/postgresql/9.6.3/bin/initdb /usr/local/var/postgres
==> 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/legacy-homebrew/issues/2510
To migrate existing data from a previous major version (pre-9.0) of PostgreSQL, see:
https://www.postgresql.org/docs/9.6/static/upgrading.html
To migrate existing data from a previous minor version (9.0-9.5) of PostgreSQL, see:
https://www.postgresql.org/docs/9.6/static/pgupgrade.html
You will need your previous PostgreSQL installation from brew to perform 'pg_upgrade'.
Do not run 'brew cleanup postgresql' until you have performed the migration.
To have launchd start postgresql now and restart at login:
brew services start postgresql
Or, if you don't want/need a background service you can just run:
pg_ctl -D /usr/local/var/postgres start
==> Summary