PostgreSQL 9.3 initial setup on Mac OSX 10.9.2 using MacPorts
After sudo port install postgresql93 postgresql93-server
# switch to su
sudo su
mkdir /var/lib/pgsql/
chown -R postgres:wheel /var/lib/pgsql
su postgres
export PGDATA=/var/lib/pgsql/9.3/data
initdb
createdb pgdbname
createuser -A -D pgusername
exit
exit
# startdb
sudo -u postgres postgres -D /var/lib/pgsql/9.3/data/
# check if login works
psql -h localhost pgdbname pgusername
\q
# add PGDATA to ~/.bash_profile
echo "export PGDATA=/var/lib/pgsql/9.3/data" >> ~/.bash_profile
Written by Deepu Mohan Puthrote
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Postgresql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#