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
Run
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
postgresql_enbale=”YES”
postgresql_data=”/usr/local/pgsql/data
into your /etc/rc.conf.