install
launch at startup
To create a database instance
start the database server using:
sudo port install postgresql84 postgresql84-server
launch at startup
sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql84-server.plist
To create a database instance
sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'
start the database server using:
sudo -u postgres /opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb
sudo -u postgres /opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/db/postgresql84/defaultdb -l logfile start
better start ,'vim /etc/profile' or 'vim ~/.profile' ,and append 'export PATH=/opt/local/lib/postgresql84/bin/:$PATH'