You can install postgresql from the ports:

cd /usr/ports/database/postgresql84-server
make install clean

The master user for the database on FreeBSD, in contrast to the master user on most Linux distributions, is called pgsql. Hence, you have to initialize the database using this user:

su - pgsql


initdb -D /usr/local/pgsql/data
postmaster -D /usr/local/pgsql/data

to finish the initialization. In order to start postgres on boot, you need to add


into your /etc/rc.conf.