PostgreSql - Установка и настройка

Установка

$ sudo apt-get install postgresql postgresql-contrib

$ passwd postgres

$ sudo su - postgres

$ psql postgres

Homebrew plst

nano /usr/local/Cellar/postgresql-9.4/9.4.5/homebrew.mxcl.postgresql.plist

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>homebrew.mxcl.postgresql.plist</string> <key>ProgramArguments</key> <array> <string>/usr/local/Cellar/postgresql-9.4/9.4.5/bin/postgres</string> <string>-D</string> <string>/usr/local/var/postgres</string> <string>-r</string> <string>/usr/local/var/postgres/server.log</string> </array> <key>RunAtLoad</key> <true/> <key>WorkingDirectory</key> <string>/usr/local/var</string> <key>StandardErrorPath</key> <string>/usr/local/var/postgres/server.log</string> </dict> </plist>

Настройка доступа

nano /etc/postgresql/X.Y/main/pg_hba.conf

local all all trust # replace ident or peer with trust
host all all 192.168.1.1/28 md5

# psql -U B -T -h localhost -U postgres